Hi Everyone,
I am using VB6 and Autodesk Map 5.
I start Autodesk Map 5 then open a drawing.
I then start my VB6 application that has one form with buttons on it.
In its OnLoad, I get the AcadApplication and the active document.
The active document is stored in ThisDrawing.
One of the button is for creating a polyline.
I send a comment _pline. Then I get the selected set.
I send a comment _pline. Then try to get the selected set which is the line that was just created.
Here is the code that is in the button click:
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.SelectionSets.Add("ss1")
ThisDrawing.SendCommand ("_pline" + vbCr)
ss.Select acSelectionSetLast
When I run the application, click on the button, then start selecting points for the polyline.
After a bit, the application fires an error. Automation error Call was rejected by callee.
I found that the sendcommand does not wait for the polyline to be completed.
So when the Select is called the drawing is busy so it fails.
I tried to call the GetAcadState to see if IsQuiescent is true or false, but that fails too.
Basically what I am tring to do is send a _pline command to autodesk map
and wait until the user either cancels it or completes a valid line.
It could take them 10 seconds or 5 minutes.
Does anyone know who I can do this?
Thanks
Michael


Reply With Quote
