I am trying to create a selection of the specified region
and then remove any text from the selection that has
"MATCH LINE" in its contents. Then I want to change the selected
elements class to "Construction".
Below is the code I have so far but I'm getting an error
on the "UnselectElement" method and the element class is not updating.
Why?
Sub SelectPipeDataForClassChange()
Dim point As Point3d, point2 As Point3d
point.X = 3500
point.Y = 930
point.Z = 0
point2.X = 300
point2.Y = 1080
point2.Z = 0
CadInputQueue.SendCommand "Choose None"
CadInputQueue.SendDragPoints point2, point, 1
Dim ee As ElementEnumerator
Dim el As Element
Dim eleText As TextElement
Dim TextString As String
TextString = "MATCH LINE"
Set ee = ActiveModelReference.GetSelectedElements
Do While ee.MoveNext
If ee.Current.IsTextElement Then
Set eleText = ee.Current
TextName = eleText.text
If TextName Like TextString Then
ActiveModelReference.UnselectElement ee.Current, True
End If
Else: Set el = ee.Current
el.Class = msdElementClassConstruction
End If
Loop
End Sub