How to Detect When a Specific DWG Template is Used

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

  1. GTVic

    GTVic Guest

    What would be a good way to mark a template DWT file so that a LISP program could easily detect it.

    Say a user starts a new drawing from a template.

    When the drawing is loaded the startup LISP (eg. in AcadDoc.lsp) runs and scans the drawing for something to indicate what template was used.

    The LISP function could check for a particular text style or block but maybe there is a more elegant method than that???
     
    GTVic, Oct 28, 2004
    #1
  2. I don't there's any way to do this from LISP, aside from
    embedding something in the template files that can be
    used to identify them.

    ObjectARX provides a means to get the original filename
    which for a new, unsaved drawing is the name of the
    template that was used to create it.
     
    Tony Tanzillo, Oct 28, 2004
    #2
  3. GTVic

    GTVic Guest

    I decided to put in a dummy block with a unique name. Part of the job of the startup LISP is to detect this block and if found to purge out all the unused blocks and linestyles - so the dummy block is deleted along with the rest.
     
    GTVic, Oct 30, 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.