VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multiple selection of objects and their layers

1 REPLY 1
Reply
Message 1 of 2
ah_4032
166 Views, 1 Reply

Multiple selection of objects and their layers

I want to filter my selection to filter text or mtext object in layer1 and filter polylines objects in layer2 by vba.

1 REPLY 1
Message 2 of 2
grobnik
in reply to: ah_4032

@ah_4032 I suggest first of all to look inside the forum, you can find a lot of examples.

As second issue look at https://help.autodesk.com/view/ACDLT/2024/ENU/?guid=GUID-A1A6DB80-A730-45D1-B035-331F549E9667

Where is indicated the Logical operator use, as you required "TEXT or MTEXT" and "POLYLINES" on layer 2

Sub Ch4_FilterBlueCircleOnLayer0()
  Dim sstext As AcadSelectionSet
  Dim FilterType(1) As Integer
  Dim FilterData(1) As Variant
  Set sstext = ThisDrawing.SelectionSets.Add("SS4")

  FilterType(0) = 0
  FilterData(0) = "LWPolyline"

  FilterType(1) = 8
  FilterData(1) = "2"

  sstext.SelectOnScreen FilterType, FilterData
End Sub

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report