Layouts

Discussion in 'AutoCAD' started by Tom, Mar 1, 2004.

  1. Tom

    Tom Guest

    Greetings. I need to create new layouts from V.L. When I create one using
    Template, I can not access the tab to change the name to something relevant.
    The name defaults to "layout-x-OriginalLayoutName". I've even tried using
    (entlast), but that just gives me the last current layout tab name. I can
    not set the new layout tab current since I won't know what the "x" value is
    on someone else's system since they might already have layout tabs. When I
    create a "New" layout, I can name it ok, but can't use a Template to create
    the layout as I wish. Any suggestions on achieving my goal either way? Is
    there a layout list access function like (tblsearch)? Are layout names
    listed anywhere? Thanks, Tom
     
    Tom, Mar 1, 2004
    #1
  2. (layoutlist)
     
    Jason Piercey, Mar 1, 2004
    #2
  3. Tom

    Devin Guest

    Layouts are listed via (layoutlist), the names are given in the form of a
    list of strings. You should probably use active-x to do what you want, ie:

    (setq; get active x objects
    acadobj (vlax-get-acad-object)
    curdoc (vla-get-activeDocument acadobj)
    layouts (vla-get-layouts curdoc)
    new_layout (vla-add layouts "newlayoutname")
    source_layout (vla-item layouts "sourcelayoutname")
    )
    (vla-copyfrom new_layout source_layout)

    (Note: I constructed the above code from the active-x docs and has not been
    tested, give it a try and let me know if it works. It should.)

    HTH,

    Devin
     
    Devin, Mar 1, 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.