vlax-release-object

Discussion in 'AutoCAD' started by GTVic, Oct 11, 2004.

  1. GTVic

    GTVic Guest

    If I need the application object I would normally do something like this:

    (setq acadapp (vlax-get-acad-object))
    ...
    (vlax-release-object acadapp)

    What if I use "vlax-get-acad-object" without assigning it to a variable. There is no way to release it then so I am wondering if that is ok.

    I am trying to implement the requirement that startup code should not be processed if AutoCAD is not visible.

    So my AcadDoc.lsp file looks like this:

    ; check if AutoCAD is visible
    (if (= :vlax-true (vlax-get-property (vlax-get-acad-object) 'Visible)) (progn

    ; startup code here

    )) ; end of code that executes only if AutoCAD is visible

    (princ)
     
    GTVic, Oct 11, 2004
    #1
  2. GTVic

    James Allen Guest

    If you haven't already, you can find a number of previous threads on this
    topic. Google->Groups->Advanced Search "vlax-release-object" will give you
    a start. Based on my search for the same thing a while back, I think you
    don't need it in that situation. Someone, Luis maybe, posted a list of
    situations where it would be needed. Some of them were vlax-get-object,
    vlax-get-or-create-object, or objects that would change type (like after
    "break"ing a circle results in an arc, the corresponding vla-object has to
    be released and re-aquired to be useful).
    --
    James Allen
    Malicoat-Winslow Engineers, P.C.
    Columbia, MO

    There is no way to release it then so I am wondering if that is ok.
    processed if AutoCAD is not visible.
     
    James Allen, Oct 26, 2004
    #2
  3. GTVic

    GTVic Guest

    Thanks, it would be nice to know for sure - the code has to go in both AcadDoc.lsp and in my .mnl file. The code is therefore executed twice for every DWG that is opened or created in AutoCAD. So if it needs to be cleaned up it could be a problem.
     
    GTVic, Oct 27, 2004
    #3
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.