- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi.
As of right now, part of my code is looping through all text elements in my drawing, checking if that texts exists as a key in a dictionary, and if so, replacing with the value.
However, I would instead like to add the new text to a different layer - rather than just overwriting existing text.
So I might have a first layer and a second layer. I want to:
1. scan all text in the first layer
2. check if it exists in dictionary
3. if so, replace with dictionary value and copy over to second layer at the same coordinates
4. if it doesn't exist in dictionary, just add the existing text to second layer
Just wondering if this is even possible. I'm new to VBA in AutoCAD and struggling to find anything on this.
Example of part of my code below:
For Each ent In ThisDrawing.ModelSpace
If TypeOf ent Is AcadText Then
Set AText = ent
If translator_dict.Exists(LCase(AText.TextString)) Then
AText.TextString = translator_dict(LCase(AText.TextString))
End If
End If
Next ent
Solved! Go to Solution.