polyline in VB6
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
polyline in VB6

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
mthomas



Joined: 12 Aug 2005
Posts: 2

Posted: Fri Aug 12, 2005 7:05 pm    Post subject: polyline in VB6 Reply with quote

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

Back to top
View user's profile Send private message
Anthony Ryan
Guest





Posted: Tue Aug 16, 2005 8:10 pm    Post subject: Re: polyline in VB6 Reply with quote

Michael,

The only way to do it that I know of is to place your selectionset code in
the EndCommand event of the drawing

eg.
Private Sub acDoc_EndCommand(ByVal CommandName As String)

If InStr(1, CommandName, "PLINE") = 1 Then
acDoc.Regen acActiveViewport
Call SetExtendedDataStationNo(acDoc,
tvDrawingNewEquipmentConstructionCodes)
EndIf
End Sub

hope this helps


Anthony



"mthomas" <hinamar@hotmail-dot-com.no-spam.invalid> wrote in message
news:VZidnSOAM7iCn2DfRVn_vQ@giganews.com...
Quote:
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
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB