RemoveLabelAt Example

Land Auto

RemoveLabelAt Example

Sub Example_RemoveLabelAt()
    
    ' This example removes a label from a Contour object by selecting the
    ' contour
    
    On Error Resume Next
    
    ' Delete existing SelectionSet
    ThisDrawing.SelectionSets("SSet").Delete
    
    ' Create the selection set based on a point selection
    ' and filter for Contour objects
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("SSet")
    
    Dim mode As Integer
    Dim gpCode(0) As Integer
    Dim dataValue(0) As Variant
    
    gpCode(0) = 0
    dataValue(0) = "AECC_CONTOUR"
    
    Dim groupCode As Variant
    Dim dataCode As Variant
    Dim returnPnt As Variant
    
    groupCode = gpCode
    dataCode = dataValue
    returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point on a contour line: ")
    ssetObj.SelectAtPoint returnPnt, groupCode, dataCode
    
    Dim Ent As AeccContour
    Set Ent = ssetObj.Item(0)
    Ent.RemoveLabelAt returnPnt(0), returnPnt(1)
    
End Sub