20 | 09 | 2017

Check if selection Set Exists

When working with selection sets double sets are created within a second. Use the following function to check for existing selection sets.

Public Function CreateSelectionSet(SSset As String) As AcadSelectionSet

'*** Code from VisibleVisual.com ********

'This Function Checks if a selection set exists
'If so it will be cleared
'If not then it will be created

Dim ss As AcadSelectionSet

On Error Resume Next

Set ss = ThisDrawing.SelectionSets(SSset)

If Err Then Set ss = ThisDrawing.SelectionSets.Add(SSset)


Set ss = ThisDrawing.SelectionSets.Item(SSset)

End Function

Sign up now and upload your code to the website.

Help us to continue.....
Articles View Hits
Latest Articles