I have the following routine which inserts text (a number from 0 to 3) at
locations picked by the user. It's actually creating 11 sets of 4 text
objects each. This routine works fine, but I want to make it possible to
modify any one of these text objects, for example, replace textObj(5,3) with
a new text string and location.
I've tried just redefining textObj(5,3) with another AddText entry, but that
only creates a new entry on top of the old entry. I know that they are all
stored as Items in aDoc.ModelSpace, so I really need to replace the Item,
not the textObj. So the question is: what's the easiest way to identify
which item is actually textObj(5,3)? I could search all items for one with
the same insertion point as the textObj, but it's possible that that might
screw up and delete the wrong thing. Any other ideas?
Thanks in advance,
John S
=========================================
Dim aDoc As AcadDocument
Dim textObj(10, 3) As AcadText
Dim Loc As Variant
for i = 0 to 10
for j = 0 to 3
Loc = aDoc.Utility.GetPoint(, "Click on the location for bond #" & j
& " on lead #")
' insert the value of "j" as a text object in the drawing
Set textObj(i, j) = aDoc.ModelSpace.AddText(j), Loc, 0.004)
next j
next i