Message 1 of 8
Selecting Object not inside an External reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi to Everybody,
I'm trying to replace a text with another inside a drawing which is containing external reference drawing (not a block).
The main issue concern that a text object will be found but not in the modelspace area but only in external reference and none of text type object outside external reference object will be found.
For Each MyEnt In ThisDrawing.ModelSpace
If TypeOf MyEnt Is AcadText Then
If InStr(1, MyEnt.TextString, "SWITCH") > 0 Then
MyEnt.TextString = "SWITCH HOUSE SH-18"
End If
End If
Next
Here a part of the code for finding text.
In order to check if the required text to replace it's really a text object type I tried with the code below selecting "by pointing" the text to be changed, and it's working fine.
Sub Testing()
Dim MyEnt As Object
Dim MyPoint As Variant
ThisDrawing.Utility.GetEntity MyEnt, MyPoint
If InStr(1, MyEnt.TextString, "SWITCH") > 0 Then
MyEnt.TextString = "SWITCH HOUSE SH-18"
End If
End Sub
Thank you for your help.