Message 1 of 4
SelectAtPoint Problem HELP !
Not applicable
07-17-2003
11:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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)
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)