Jump to content

Recommended Posts

Posted

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!

Posted

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

Posted

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)
)


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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...