22 | 06 | 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)

ss.Clear

Set ss = ThisDrawing.SelectionSets.Item(SSset)

End Function
Login

Sign up now and upload your code to the website.

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