get AeccApplication from DLL

Discussion in 'AutoCAD' started by mgrigoriev, Mar 18, 2005.

  1. mgrigoriev

    mgrigoriev Guest

    Hi,
    I have a sub called DX in a DLL:
    Sub DX(Application As Object)
    Set ThisDrawing = Application.ActiveDocument
    'Do stuff here
    end sub

    I am calling it using a lisp routine:
    (defun c:test ()
    (vl-load-com)
    (setq acadapp (vlax-get-acad-object))
    (setq obj (vlax-invoke-method acadapp 'GetInterfaceObject "Common.clsTest"))
    (vlax-invoke obj 'DX acadapp)
    )

    What should I do to invoke a AeccApplication? In order to use AeccApplication objects, I would probably pass a second attribute to my DX routine, right?
    Thanks,
    Mike
     
    mgrigoriev, Mar 18, 2005
    #1
  2. mgrigoriev

    James Buzbee Guest

    First you need to initialize the AecBaseDocument: the Lisp syntax for 2005
    would be:

    (setq acadapp (vlax-get-acad-object)
    ret (vlax-invoke acadapp "getinterfaceobject"
    "AecX.AecBaseDocument.4.5")
    doc (vlax-get acadapp "ActiveDocument")))

    (vlax-invoke ret "init" doc)

    ;end code

    Now the active document object "points" to the AecBaseDocument which
    contains all the AEC container stuff. Remember that the Schedule and
    Structural Objects are not included in the BaseDocument Object and need to
    be initialized seperately. So I don't think you need the VB part - all of
    the Aec Object Data is accessible through LISP.

    The only downside is, as of 2005, Aec Objects are not exposed to the
    ObjectDBX interface object - so you'll need to access those through the
    dictionaries.

    jb
     
    James Buzbee, Mar 21, 2005
    #2
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.