Getting the current layout CTB file?

Discussion in 'AutoCAD' started by Jorge Z, Feb 13, 2004.

  1. Jorge Z

    Jorge Z Guest

    I was wondering if there was a VAR that stored the current layout's CTB
    file. I want to return this variable and input it into a disiel datestamp
    with rtext. I've looked pretty much thru all the system var's via the
    express menu >tools > system variable editor, but I cant seem to find
    anything usefull. Does anyone have any ideas?

    Jorge
     
    Jorge Z, Feb 13, 2004
    #1
  2. Jorge Z

    Jeff Mishler Guest

    Nope, no var. It is stored as a property of the Layout. Here's a way,
    using ActiveX, to retrieve it. Add this to autoload with each drawing
    and use (getctb) at the command line to return the value.
    I've never used Rtext, so I'm not positive that you can use lisp inside
    a diesel. If not, the routine sets the USERS5 var to the value returned
    and rtext can get that value......

    (defun getctb ()
    (setvar "users5"(vla-get-stylesheet (vla-item
    (vla-get-layouts
    (vla-get-activedocument
    (vlax-get-acad-object)
    )
    )
    (getvar "ctab"))))
    )

    The only thing is that with this method you need to run the (getctb)
    each time you switch layouts or ctb files.

    HTH,
    Jeff
     
    Jeff Mishler, Feb 14, 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.