PDA

View Full Version : Plotting issue


tyeelaw13
2005-10-19, 05:26 PM
Ok, i have a lisp routine that will run through all of the layouts and plot them in alphabetic order. When i try to use the same type of lisp for creating dwf's or pdf's it won't execute.

Here is the lisp that works:
(defun c:PlotLayouts ()
(setq lay_list (layoutlist)
lay_list_len (length lay_list)
lay_nth 0
)
(repeat lay_list_len
(command "layout" "set" (nth lay_nth lay_list))
(command "zoom" "e")
(plot2436)
(setq lay_nth (1+ lay_nth))
)
(princ)
)
(defun plot2436 ()
(command "-plot" "y" ""
"Oce 9400.pc3" "ARCH expand D (24.00 x 36.00 Inches)"
"i" "L" "N"
"W" "0.000000,0.000000"
"36.000000,24.000000" "1:1"
"C" "Y" "Pens - 24x36.ctb"
"Y" "N" "N"
"N" "N" "Y"
"Y"
)
)Here is the lisp that doesn't work. I get error: no function definition: PLOTDWF
(defun c:Pltdwf ()
(setq lay_list (layoutlist)
lay_list_len (length lay_list)
lay_nth 0
)
(repeat lay_list_len
(command "layout" "set" (nth lay_nth lay_list))
(command "zoom" "e")
(plotdwf)
(setq lay_nth (1+ lay_nth))
)
(princ)
)
(DEFUN C:plotDWF ()
(COMMAND "-plot" "y" ""
"dwf classic.pc3" "ARCH expand D (24.00 x 36.00 Inches)"
"i" "L" "N"
"W" "0.000000,0.000000"
"36.000000,24.000000" "1:1"
"C" "Y" "Pens - 24x36.ctb"
"Y" "N" "N"
"N" "~" "Y"
"Y"
)
)ANY SUGGESTIONS? I tried with my acrobat distiller too, and it did the same thing.

Thank you in advance

T.Willey
2005-10-19, 05:44 PM
Look at how you named the PlotDWF function, and how you call it.

Opie
2005-10-19, 06:13 PM
Ok, i have a lisp routine that will run through all of the layouts and plot them in alphabetic order. When i try to use the same type of lisp for creating dwf's or pdf's it won't execute.

Here is the lisp that works:

(defun c:PlotLayouts ()
(setq lay_list (layoutlist)
lay_list_len (length lay_list)
lay_nth 0
)
(repeat lay_list_len
(command "layout" "set" (nth lay_nth lay_list))
(command "zoom" "e")
(plot2436)
(setq lay_nth (1+ lay_nth))
)
(princ)
)

(defun plot2436()
(command "-plot" "y" "" "Oce 9400.pc3" "ARCH expand D (24.00 x 36.00 Inches)" "i" "L" "N" "W" "0.000000,0.000000" "36.000000,24.000000" "1:1" "C" "Y" "Pens - 24x36.ctb" "Y" "N" "N" "N" "N" "Y" "Y"))


Here is the lisp that doesn't work. I get error: no function definition: PLOTDWF

(defun c:Pltdwf ()
(setq lay_list (layoutlist)
lay_list_len (length lay_list)
lay_nth 0
)
(repeat lay_list_len
(command "layout" "set" (nth lay_nth lay_list))
(command "zoom" "e")
(plotdwf) ;; <- either change this call to the correct name or remove the c: from the definition
(setq lay_nth (1+ lay_nth))
)
(princ)
)

(DEFUN C:plotDWF()(COMMAND "-plot" "y" "" "dwf classic.pc3" "ARCH expand D (24.00 x 36.00 Inches)" "i" "L" "N" "W" "0.000000,0.000000" "36.000000,24.000000" "1:1" "C" "Y" "Pens - 24x36.ctb" "Y" "N" "N" "N" "~" "Y" "Y"))


ANY SUGGESTIONS? I tried with my acrobat distiller too, and it did the same thing.

Thank you in advance
Has the PlotDWF been defined prior to you executing the PltDWF? This could be simply the order in which the routines are defined.

Edit
Forget what I said. The definition of C:PlotDWF and the call to plotdwf do not match.

tyeelaw13
2005-10-19, 08:57 PM
removing the c: did it. Thanks a bunch!

Opie
2005-10-19, 08:59 PM
removing the c: did it. Thanks a bunch!
You removed the hard drive? :shock: I kid.

I'm glad you got it running.

tyeelaw13
2005-10-20, 10:27 PM
Yea, it's pretty nice! Having the ability to dwf all of the layout tabs in order in a timely manner helps out tremendously.

Here's the final code:
(defun c:Pltdwf ()
(setq lay_list (layoutlist)
lay_list_len (length lay_list)
lay_nth 0
)
(repeat lay_list_len
(command "layout" "set" (nth lay_nth lay_list))
(command "zoom" "e")
(plotdwf)
(setq lay_nth (1+ lay_nth))
)
(princ)
)
(DEFUN plotDWF ()
(COMMAND "-plot" "y" ""
"dwf classic.pc3" "ARCH expand D (24.00 x 36.00 Inches)"
"i" "L" "N"
"W" "0.000000,0.000000"
"36.000000,24.000000" "1:1"
"C" "Y" "Pens - 24x36.ctb"
"Y" "N" "N"
"N" "~" "Y"
"Y"
)
)Feel free to use it for your own! You'll need to change a few settings in the bottom part to match your standard plot settings. I recommend running a plot and then running -plot on the command line. Once you run through it once, you can hit the F2 button and copy & paste all the changes into the lisp routine. Here are the things that will need to change:
Pen style
Paper size (may or may not need to be changed depending on your settings)

Yes- it will prompt you for a file name and location.

Thanks again to everyone!

kennet.sjoberg
2005-10-20, 11:04 PM
Feel free to use ...
Thank you, will this work for you ?

(defun c:Pltdwf (/ )
(foreach LayOut (layoutlist )
(command "._layout" "set" LayOut )
(command "zoom" "e")
(command "-plot" "y" "" "dwf classic.pc3" "ARCH expand D (24.00 x 36.00 Inches)" "i" "L" "N" "W" "0.000000,0.000000" "36.000000,24.000000" "1:1" "C" "Y" "Pens - 24x36.ctb" "Y" "N" "N" "N" "~" "Y" "Y")
)
(princ)
)

: ) Happy Computing !

kennet