Results 1 to 2 of 2

Thread: polyline in VB6

  1. #1
    Join Date
    Aug 2005
    Posts
    2

    polyline in VB6

    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

  2. #2
    Anthony Ryan Guest
    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...
    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

Similar Threads

  1. curvy polyline
    By max-cad in forum AutoCAD
    Replies: 0
    Last Post: 02-15-2012, 08:27 AM
  2. Points along a polyline
    By DeadTaco in forum VBA
    Replies: 0
    Last Post: 08-16-2005, 05:10 PM
  3. Polyline inside and tangent to polyline
    By R3v3nG3 in forum VBA
    Replies: 2
    Last Post: 08-02-2005, 09:10 AM
  4. Polyline intersect itself
    By Gustavo Guidi in forum Customization
    Replies: 5
    Last Post: 01-18-2005, 02:02 AM
  5. LW Polyline??
    By bullfrog in forum AutoCAD
    Replies: 3
    Last Post: 11-19-2004, 03:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum