Results 1 to 9 of 9

Thread: Select all Objects inside a Polyline

  1. #1
    Active Member
    Join Date
    2005-02
    Posts
    95
    Login to Give a bone
    0

    Default Select all Objects inside a Polyline

    I have somany closed polyline in this polyline I have some entities/objects/text. I want to get the program of all the objects are selected in the polyline in one pick like hatch




    pixlepark96@sancharnet.in

  2. #2
    I could stop if I wanted to Hammer.John.J's Avatar
    Join Date
    2015-09
    Location
    Springfield, MA
    Posts
    491
    Login to Give a bone
    0

    Default Re: Select all Objects inside a Polyline

    when you are selecting you have the option to use "WP" which i think means window polygline

  3. #3
    All AUGI, all the time zoomharis's Avatar
    Join Date
    2005-02
    Location
    Abu Dhabi (Native-India)
    Posts
    506
    Login to Give a bone
    0

    Smile Re: Select all Objects inside a Polyline

    Hi Avinash,

    I have done some experiments on it and the program works works well in AutoCAD 2004. Just try the following code.

    Code:
     
    Sub selEntByPline()
    On Error Resume Next
    Dim objCadEnt As AcadEntity
    Dim vrRetPnt As Variant
    ThisDrawing.Utility.GetEntity objCadEnt, vrRetPnt
    If objCadEnt.ObjectName = "AcDbPolyline" Then   '|-- Checking for 2D Polylines --|
    	Dim objLWPline As AcadLWPolyline
    	Dim objSSet As AcadSelectionSet
    	Dim dblCurCords() As Double
    	Dim dblNewCords() As Double
    	Dim iMaxCurArr, iMaxNewArr As Integer
    	Dim iCurArrIdx, iNewArrIdx, iCnt As Integer
    	Set objLWPline = objCadEnt
    	dblCurCords = objLWPline.Coordinates	'|-- The returned coordinates are 2D only --|
    	iMaxCurArr = UBound(dblCurCords)
    	If iMaxCurArr = 3 Then
    		ThisDrawing.Utility.Prompt "The selected polyline should have minimum 2 segments..."
    		Exit Sub
    	Else
    		'|-- The 2D Coordinates are insufficient to use in SelectByPolygon method --|
    		'|-- So convert those into 3D coordinates --|
    		iMaxNewArr = ((iMaxCurArr + 1) * 1.5) - 1   '|-- New array dimension
    		ReDim dblNewCords(iMaxNewArr) As Double
    		iCurArrIdx = 0: iCnt = 1
    		For iNewArrIdx = 0 To iMaxNewArr
    			If iCnt = 3 Then	'|-- The z coordinate is set to 0 --|
    				dblNewCords(iNewArrIdx) = 0
    				iCnt = 1
    			Else
    				dblNewCords(iNewArrIdx) = dblCurCords(iCurArrIdx)
    				iCurArrIdx = iCurArrIdx + 1
    				iCnt = iCnt + 1
    			End If
    		Next
    		Set objSSet = ThisDrawing.SelectionSets.Add("SEL_ENT")
    		objSSet.SelectByPolygon acSelectionSetWindowPolygon, dblNewCords
    		objSSet.Highlight True
    		objSSet.Delete
    	End If
    Else
    	ThisDrawing.Utility.Prompt "The selected object is not a 2D Polyline...."
    End If
    If Err.Number <> 0 Then
    	MsgBox Err.Description
    	Err.Clear
    End If
    End Sub
    I hope it works. Please try to give me feedback so that we can make it better. I doubt that the program can be much shorter. But this is all i can do for now.

    Happy Experiments.....

    har!s

  4. #4
    Active Member
    Join Date
    2005-02
    Posts
    95
    Login to Give a bone
    0

    Default Re: Select all Objects inside a Polyline

    Its great but I still want different type of program

    We have a polygon but we don't select but only pick in an internl any point (Like hatch "Pick an Internal point")


    Avinash Patil
    pixlepark96@sancahrnet.in

  5. #5
    All AUGI, all the time zoomharis's Avatar
    Join Date
    2005-02
    Location
    Abu Dhabi (Native-India)
    Posts
    506
    Login to Give a bone
    0

    Default Re: Select all Objects inside a Polyline

    Quote Originally Posted by avinash00002002
    We have a polygon but we don't select but only pick in an internl any point (Like hatch "Pick an Internal point")
    I don't know what difference that makes. The above program is just like using HATCH command with OBJECT option. Can you please tell me exactly why you need to pick an internal point...? I may be able to sort it out.

    By the way, I don't care about the paths, I only care the destination.....


    har!s

  6. #6
    Active Member
    Join Date
    2005-02
    Posts
    95
    Login to Give a bone
    0

    Default Re: Select all Objects inside a Polyline

    Thanx for care

    I need that I have a somany polylines in this polylines have somany text, I need to pick an Internal point so that every text in the polyline all the text are selected,


    pixlepark96@sancharnet.in

  7. #7
    Member bradlyferrell's Avatar
    Join Date
    2006-03
    Location
    Nashville, TN
    Posts
    31
    Login to Give a bone
    0

    Smile Re: Select all Objects inside a Polyline

    Quote Originally Posted by avinash00002002
    Thanx for care

    I need that I have a somany polylines in this polylines have somany text, I need to pick an Internal point so that every text in the polyline all the text are selected,


    pixlepark96@sancharnet.in
    Hello Avinash,
    What version of AutoCAD are you using?
    And, are you wanting a VB/VBA program that allows you to choose all text within a closed polyline or just "some command" within Acad?

    Hope we can help.

  8. #8
    Active Member
    Join Date
    2005-02
    Posts
    95
    Login to Give a bone
    0

    Default Re: Select all Objects inside a Polyline

    I am using AutoCAD 2006 and I waiting for your program

    pixlepark96@sancharnet.in

  9. #9
    Member
    Join Date
    2014-10
    Posts
    2
    Login to Give a bone
    0

    Default Re: Select all Objects inside a Polyline

    what is the key to use this lisp
    like we press bf for batch find?
    I used appload and lisp was sucesssfully loaded and next step is
    I have a huge drawing and i have drawn a polyline. Now I want to select all objects inside that polyline
    Please Help

Similar Threads

  1. Looking for lisp routine to select objects inside polyline
    By vlad_tzok133583 in forum AutoLISP
    Replies: 22
    Last Post: 2022-04-29, 05:44 AM
  2. Select polyline segment
    By krkeec763189 in forum Dot Net API
    Replies: 3
    Last Post: 2013-02-02, 07:14 PM
  3. Select polyline and get coordinates
    By avinash patil in forum Dot Net API
    Replies: 5
    Last Post: 2012-11-04, 08:24 PM
  4. Fade/opacity inside a polyline/boundary?
    By bernt.noodt in forum AutoCAD Map 3D - General
    Replies: 1
    Last Post: 2007-02-21, 02:42 PM
  5. Is my selected point inside a closed polyline?
    By edward.bagby in forum VBA/COM Interop
    Replies: 7
    Last Post: 2006-11-21, 12:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •