#2
Hi wonton,

You can use a selection set with filter by Layer. Here is an example on how to delete all the entities drawn on "MyLayer":

Code: Select all

Public Sub DeleteAllEntitiesInMyLayer()

    'Initializes a new SelectionSet:
    Dim sset As IntelliCAD.SelectionSet
    
    'Defines the filter for the SelectionSet:
    Dim filterTypes(0) As Integer
    Dim filterData(0) As Variant
    filterTypes(0) = 8: filterData(0) = "MyLayer"
        
    'Creates the selection using the SelectionSet:
    Set sset = IntelliCAD.ActiveDocument.SelectionSets.Add("MyLayerSSet")
    Call sset.Select(IntelliCAD.SelectionSetType.vicSelectionSetAll, , , filterTypes, filterData)
        
    Dim i As Integer
    Dim ent As IntelliCAD.entity
        
    For i = 1 To sset.Count
        
        'Gets the entity:
        Set ent = sset.Item(i)
                
        'Deletes the entity:
        ent.Delete
                
    Next i
        
End Sub
Regards,
JCAMPOS
cron