Hi,
If the text is the last entity added to the drawing, you can get it through
VBA code something like this,
Dim count As Integer
count = ThisDrawing.ModelSpace.count 'Get the total number of entities in
Model Space
Dim obj As AcadEntity
Set obj = ThisDrawing.ModelSpace.Item(count - 1) ' Get the last entity added
to model space
...
...
...
...
Hope this helps,
regards,
Raju.K.,
GIS Engineer
"BillMasters" wrote in message
news:f178dab.-1@WebX.maYIadrTaRb...
Hi All.
I have developed a rather simple VB and Autocad Map program to maintain
Street centerlines for a municipality. I am working on a annotation feature
so the user can add the street names fairly quickly (by selecting the
street, and selecting the start point of the text, it gets the street name
from the db). HOWEVER. we want to be able to store info about the
annotations in the DB as well so that they could be rebuilt if necessary.
Here lies the problem. Im am using send command to create the text on the
map. and then i want to get the handle of the newly added text. There seems
to be a problem with the selectAtPoint (to add the text object to a
selection set) method, sometimes it works, sometimes not. And ive checked
the coordinates its using to get the object, and they are fine. I will
include a code snippet below. any help/insight/workarounds for this problem
would be greatly appreciate. THANKS !! bill
Dim selPnt(2) As Double
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.SelectionSets.Add("ss_centerline")
'insertPnt is the coordinates at which the text was inserted.
selPnt(0) = insertPnt(0)
selPnt(1) = insertPnt(1)
selPnt(2) = 0
SEND COMMAND LINE TO ADD TEXT TO MAP
ss.Clear
ss.SelectAtPoint (selPnt)