(vl-load-com)

Discussion in 'AutoCAD' started by Adesu, Nov 2, 2004.

  1. Adesu

    Adesu Guest

    If we load code contained vla or vlax etc,sure before that ,we must load
    "(vl-load-com)", I want ask how to load code without "(vl-load-com)",but if
    the code contained vla/vlax it must be work too.
     
    Adesu, Nov 2, 2004
    #1
  2. Off the top of my head....

    1. Get a list of all the functions implemented in VLCom.arx,
    which are not methods of a vla-object. For example,
    vlax-get-acad-object; vla-ename->vla-object, etc.

    2. If vl-load-com has not been called, then define all of
    those same functions described above, like so (using
    vlax-get-acad-object as an example):

    (if (not vlax-get-acad-object) ; then vl-load-com was not called yet
    (progn

    (defun vlax-get-acad-object ()
    (vl-load-com)
    (vlax-get-acad-object)
    )

    ;; Another example, with a function that takes
    ;; an argument:

    (defun vlax-ename->vla-object (x)
    (vl-load-com)
    (vlax-ename->vla-object x)
    )

    ); progn
    ); if (not vlax-get-acad-object)

    You don't have to do this for vla-* functions since
    I don't believe you can call any of them without
    first calling one of the functions described above
    (that is, functions defined in vlcom.arx, which are
    not methods of a vla-object).

    This should work even if someone else calls (vl-load-com),
    since all of the functions will be redefined.
     
    Tony Tanzillo, Nov 2, 2004
    #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.