changing layouts for multiple drawings..

Discussion in 'AutoCAD' started by Jan-Mikael Kristiansson, Jan 29, 2004.

  1. Hi!
    I have maybe 1000 drawings wich are made in R14. They all have a paperzize
    in the layout that I'm not happy with. I want to change the paperzize
    automaticly in all drawings. Right now I'm doing it manually and it is very
    time consuming. I already have a lisp-file that can generate a script and
    open a file wich performs any commands i put in there. Then this lisp saves
    the dwg-files in the version I selected. The thing is that I don't know how
    to write a command to change layout-settings? The layout command only seem
    to be able to change name of existing layouts, making new layouts etc..not
    being able to perform all "advanced" settings from command-line. Does
    anybody have a clue how I can proceed here?

    thx

    Mikael
     
    Jan-Mikael Kristiansson, Jan 29, 2004
    #1
  2. Jan-Mikael Kristiansson

    rewilson Guest

    You can use aclyutil.arx and set up the page in a template, then do a pageout. That would write the script the import the page setup. For the layout, do this:
    (thanks to Jason Peircey .......credit where credit is due)
    (defun c:implay ()
    (setvar "tilemode" 0)
    (setq lst (mapcar 'strcase (vl-remove "Model" (layoutlist))))
    (foreach x (mapcar 'strcase
    '("yourlayout1" "yourlayout2" "yourlayout3"))
    (if (vl-position x lst)
    (princ "\nlayout already exists")
    (command "layout" "t" "mylayouttemplate.dwt" x)))
    (command "layout" "d" "existinglayout1")
    (command "layout" "d" "existinglayout2")
    (setvar "ctab" "layout you want to set up")
    (princ))
    I use this method for converting vendor drawings to our standards. It can all be done in a script, but there may be a better way to do it. It works well for me.
    HTH
    Russ
     
    rewilson, Jan 29, 2004
    #2
  3. Thanks, I will try this. =)

    /Mikael


    pageout. That would write the script the import the page setup. For the
    layout, do this:
    all be done in a script, but there may be a better way to do it. It works
    well for me.
     
    Jan-Mikael Kristiansson, Jan 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.