ILoveMadoka Posted February 10, 2011 Posted February 10, 2011 We get drawings that sometimes use model space and paper space and some that use only one or the other. I have a little lisp (script) but I have to comment lines in/out depending upon the circumstances of the drawing. Can it be written such that there is a user choice for the "foreach" lines? I don't know how to do it... Here's what I have... (defun c:PS1 () (foreach tab (cons "Model" (layoutlist)) ;;For Model Space too use this!! ;(foreach tab (layoutlist) ;;For Paper Space only (setvar 'CTAB tab) (Command "-plot" "y" "" "\\\\sc1fs1\\c01886" "11x17" "i" "L" "n" "e" "f" "center" "y" "monochrome.ctb" "y" "n" "n" "n" "n" "y" "n") (COMMAND "Zoom" "e") ) (command "qsave") (princ)) Thanks! Quote
Smirnoff Posted February 10, 2011 Posted February 10, 2011 May be something like this? (defun c:ps2() (foreach tab (cons "Model" (layoutlist)) (setvar "CTAB" tab) (command "_.zoom" "_e") (initget 1 "Yes No") (if(= "Yes"(getkword "\nDo you want to plot this!? [Yes/No]: ")) (command "-plot" "y" "" "\\\\sc1fs1\\c01886" "11x17" "i" "L" "n" "e" "f" "center" "y" "monochrome.ctb" "y" "n" "n" "n" "n" "y" "n") ); end if ); end foreach (command "_.qsave") (princ "\n It seems all... ") (princ) ); end of c:ps2 Quote
rkmcswain Posted February 10, 2011 Posted February 10, 2011 How about something like this? (defun c:PS1 () (initget "A M L") (setq ans (getkword "\nOperate on [Model/Layouts/All] ")) (cond ((eq ans "A")(setq myset (cons "Model" (layoutlist)))) ((eq ans "L")(setq myset (layoutlist))) ((eq ans "M")(setq myset (list "Model"))) ) (foreach tab myset (setvar 'CTAB tab) (Command "-plot" "y" "" "\\\\sc1fs1\\c01886" "11x17" "i" "L" "n" "e" "f" "center" "y" "monochrome.ctb" "y" "n" "n" "n" "n" "y" "n") (COMMAND "Zoom" "e") ) (command "qsave") (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.