vbarun clears the PickfirstSelectionSet

Discussion in 'AutoCAD' started by Ad Brouwer, Nov 3, 2004.

  1. Ad Brouwer

    Ad Brouwer Guest

    accessing the PickfirstSelectionSet from vb6 works as it should be, but when
    starting a vba script with vbarun, the vba script always reports a
    PickfirstSelectionSet.count of 0.

    It seems that vbarun clears the PickfirstSelectionSet.

    Does anyone have the same problem or perhaps a solution?

    Ad Brouwer
     
    Ad Brouwer, Nov 3, 2004
    #1
  2. The only way to access the pickfirst selection set from
    a VBA macro, is to start it with the vla-runmacro method
    from LISP:

    (defun C:VBARUNX ()
    (vl-load-com)
    (vla-runmacro
    (vlax-get-acad-object)
    (getstring "\nMacro name: ")
    )
    (princ)
    )
     
    Tony Tanzillo, Nov 3, 2004
    #2
  3. Ad Brouwer

    Ad Brouwer Guest

    Thanks Tony.


     
    Ad Brouwer, Nov 4, 2004
    #3
  4. Ad Brouwer

    mccad Guest

    User Events to solution.
    ex.:

    Private Sub AcadDocument_BeginLisp(ByVal FirstLine As String)
    Select Case UCase(FirstLine)
    Case "(C:GADD)"
    AddUnNameGroup
    Case "(C:GDEL)"
    MsgBox "gdel"
    DelUnNameGroup
    End Select
    End Sub
    (defun c:gadd()(princ)) (defun c:gdel()(princ))

    command:gadd

    use "gadd" to run AddUnNameGroup.

    =======
    http://www.mjtd.com

    http://www.mjtd.com/a2/list.asp?id=434
     
    mccad, Nov 4, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.