Jump to content

Print Preview with "Previous Plot" Page Setup


JeepMaster

Recommended Posts

Can someone help me out on creating this lisp. Sometimes when I need to print a set of drawings, I would go PLOT, select my page setup, then PREVIEW to double check, then PLOT. After that on the rest of the drawings, I would do PLOT, select page setup "PREVIOUS PLOT", PREVIEW, then PLOT.

 

Now would it be possible to go straight to PLOT PREVIEW with "Previous Plot" page setting. I know if I have the proper page setup done on all drawings, I could just click the plot preview, but there are times I need to plot with odd settings. Please help.

Link to comment
Share on other sites

One way (probably not ideal, but all I can think of) would be having the LISP save the previous plot settings to the page setup, then invoke the "PREVIEW" command.

 

(defun c:ppp ()
 (command "-plot" "no" "" "previous plot" "" "" "y" "n")
 (command "preview")
 (princ)
)

Link to comment
Share on other sites

Thanks uddfl,

I never thought of it that way. It seems to work fine. I've added an undo command so the pagesetup will not saved to the drawing. I'm pretty sure there's a better way of doing this. If anybody have something better, please post.:)

(defun c:PPP (); Plot Preview Previous
 (command "undo" "be")
 (command "-plot" "no" "" "previous plot" "" "n" "y" "n")
 (command "preview")
 (command "undo" "e")
 (command "undo" "1")
 (command "regenall")
 (princ)
)

Link to comment
Share on other sites

  • 5 months later...

You mean like this.

(defun c:PlotP (); Plot Previous
 (command "-plot" "no" "" "previous plot" "" "n" "y" "n")
 (princ)
)

Link to comment
Share on other sites

Sorry my mistake,

The last command was asking if you want to print it.:D I forgot it was used as a preview only before.

(defun c:PlotP (); Plot Previous
 (command "-plot" "no" "" "previous plot" "" "n" "y" "[color=Red]y[/color]")
 (princ)
)

It works fine now. You can also not save the page setup using this.

 (defun c:PlotP (); Plot Previous
 (command "-plot" "no" "" "previous plot" "" "n" "[color=Red]n[/color]" "[color=Red]y[/color]")
 (princ)
) 

Link to comment
Share on other sites

That works great, however when i try to combine them both into one code the print preview previous doesnt work can you explain why?

 

 (defun c:PP (); Plot Previous
 (command "-plot" "no" "" "previous plot" "" "n" "n" "y")
 (princ)
)

(defun c:PPP (); Plot Preview Previous
 (command "undo" "be")
 (command "-plot" "no" "" "previous plot" "" "n" "y" "n")
 (command "preview")
 (command "undo" "e")
 (command "undo" "1")
 (command "regenall")
 (princ)

 

Also, what would i need to do to incorporate a prompt on the previous plot to ask, "Do you want to Preview the plot?" & "Do you want to plot using the previous settings?"

 

Thanks in advance

Z

Link to comment
Share on other sites

You're missing a ")" in the very end of the code.

(defun c:PP (); Plot Previous
 (command "-plot" "no" "" "previous plot" "" "n" "n" "y")
 (princ)
)

(defun c:PPP (); Plot Preview Previous
 (command "undo" "be")
 (command "-plot" "no" "" "previous plot" "" "n" "y" "n")
 (command "preview")
 (command "undo" "e")
 (command "undo" "1")
 (command "regenall")
 (princ)
)

 

You could add a new main routine and call the PP or PPP subroutine when user pick yes. But now you're making a simple task more complicated.

Link to comment
Share on other sites

Zorg, if you use the Visual LISP Editor provided in AutoCAD to write LISP files, errors such as missed parentheses can be picked up easily - as it has a built in function to do this.

 

Or, if you do not like the Visual LISP Editor, maybe Notepad++ or Vim.

 

Lee

Link to comment
Share on other sites

Was never sure how to use it, Lee. I don't excatly have enough time to use LISP, i only spend about 30 minutes each day in it and dont want to be doing when i get home :lol: but i'll definatley have a look into it. Thanks

 

Z

Link to comment
Share on other sites

Here's a brief "Quick-Start" guide :P

 

  • Open AutoCAD.
  • Type either VLIDE or VLISP at the command line (both do the same thing).
  • Go to File > New (don't type on the part with the "$" signs (that is the console).
  • Start Typing your LISP file.
  • Load it using the load button.
  • Run it as usual.

Lee

Link to comment
Share on other sites

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