- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I created a selection set which selects all objects in a certain layer. I looped over the selected objects successfully and highlighted them. Highlight property only highlights the objects. However, I cannot see any object selected on the scene... The dropdown list in the properties panel shows "No selection".
How do I select objects on the model from selectionset created in VBA?
Autocad Version: 2015
Code:
Function selectLayer(inLayer As String)
Dim polylines As AcadSelectionSet
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
Dim pl As AcadLWPolyline
On Error Resume Next
Set polylines = ThisDrawing.SelectionSets.Add("polylinesSS")
If Err.Number <> 0 Then
ThisDrawing.SelectionSets.Item("polylinesSS").Delete
Set polylines = ThisDrawing.SelectionSets.Add("polylinesSS")
End If
FilterType(0) = 8
FilterData(0) = inLayer
polylines.Select acSelectionSetAll, , , FilterType, FilterData
'For Each entity In polylines
'
' If TypeOf entity Is AcadLWPolyline Then
'
' Set pl = entity
' pl.Highlight (True)
'
'
' End If
'
'Next
End Function
Solved! Go to Solution.