Layout Names question?

Discussion in 'AutoCAD' started by Mark Douglas, May 5, 2004.

  1. Mark Douglas

    Mark Douglas Guest

    Im trying to write a Code that will set the Page setup of all my layout tabs
    to either 8 1/2 x 11 or 24x36 depending on the layout name in a drawing. If
    it named with a S first then I want it to be set to 24x36. If it has a F I
    want it to be set to 8 1/2 x 11. Anyone got any ideas? I tried using
    (layoutList) but it gives me a weird list and cant get just the S or F
    layout names to run?

    (DEFUN C:DWFSETUP (/ paper papersize orient)
    (setq papersize (strcase (getstring "A / D or E Size Paper? : ")))
    (if (= papersize "A") (setq paper "ANSI full bleed A (8.50 x 11.00
    Inches)"))
    (if (= papersize "D") (setq paper "ARCH full bleed D (24.00 x 36.00
    Inches)"))
    (if (= papersize "E") (setq paper "ARCH full bleed E1 (30.00 x 42.00
    Inches)"))
    (if (= papersize "A") (setq orient "P"))
    (if (= papersize "D") (setq orient "L"))
    (if (= papersize "E") (setq orient "L"))
    (foreach x (layoutlist)
    (command "-plot" "y" "" "DWF6 ePlot.pc3" paper "I" orient "n" "e" "1:1" "c"
    "y" "MKM DWF.ctb" "y" "n" "n" "n" "n" "y" "n")
    (princ))

    Thanks for any help!!!

    Mark
     
    Mark Douglas, May 5, 2004
    #1
  2. Not sure what your question is, exactly. If you are
    trying to get the first character of each layout name
    in the current drawing then perhaps....

    (mapcar '(lambda (x) (substr x 1 1)) (layoutlist))

    --

    Autodesk Discussion Group Facilitator


    <snip>
     
    Jason Piercey, May 5, 2004
    #2
  3. Mark Douglas

    Mark Douglas Guest

    Ok sorta what im looking for......
    Here is a little better explanation.

    I have layouts named......S1 \S2 \ S3 \F1 \ F2 \ F4
    I want to get a selection set of all the "S" sheets to be set to 24x36
    And all the "F" sheets to be set to 8 1/2 x 11.

    So then I can use (foreach x

    To set all the layout tabs that have a "S" at the beginning to 24x36 page
    setups.

    This make a little more sense?

    Thanks again Jason for all your help!!

    Mark
     
    Mark Douglas, May 5, 2004
    #3
  4. Ok, how about something like this....

    (foreach item (vl-remove "Model" (layoutlist))
    (setq item (strcase item))
    (cond
    ((wcmatch item "S*") (princ "\ndo stuff with 'S' layouts"))
    ((wcmatch item "F*") (princ "\ndo stuff with 'F' layouts"))
    (t nil)
    )
    )

    You are welcome.
     
    Jason Piercey, May 5, 2004
    #4
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.