Current Layout to specified page setup current

Current Layout to specified page setup current

Philj215
Participant Participant
459 Views
7 Replies
Message 1 of 8

Current Layout to specified page setup current

Philj215
Participant
Participant

We setup multiple page setups on all of our drawings that are the same. One of them is called PDF. I want to set the current layout to "PDF" page setup. Is there a lisp routine that will achieve this to save me some time?

 

I normally do this process:

 

type: pagesetup

click PDF from the page setups

click the set current button

 

Philj215_1-1671724997553.png

 

 

0 Likes
460 Views
7 Replies
Replies (7)
Message 2 of 8

paullimapa
Mentor
Mentor
0 Likes
Message 3 of 8

cadffm
Consultant
Consultant

@paullimapa wrote:

Explore Ctab variable 

https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/AutoC...


I would say: Command -PLOT no

and stop the plot at the end of this command.

 

CTab is good for a layout jump, not to set a pagesetup.

 

@Philj215 

Sure you will find a short tool to set your named pagesetup,

but -PLOT is the way to go if you like to create your own solution.

 

Sebastian

Message 4 of 8

paullimapa
Mentor
Mentor

try using this lisp function to do this but Note: Does not check if given pagesetup name exists or applies to given layout space

 

; putPagesetup function places an existing pagesetup onto layout
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-for-page-setup/td-p/9386936
; arguments:
; document - (vla-get-activedocument(vlax-get-acad-object))
; layout - (getvar"ctab")
; setup - existing pagesetup name
; Usage:
; (putPagesetup (vla-get-activedocument(vlax-get-acad-object)) (getvar"ctab") "PageSetup Paper") ; given existing pagesetup name: "PageSetup Paper"
; Note: Does not check if given pagesetup name exists or applies to given layout space
; Returns T if successfull or Nil if fails
(defun putPagesetup (document layout setup) 
;Jason Piercey
(vl-load-com) 
	(if 
		(vl-catch-all-error-p  (vl-catch-all-apply  
			(function  
				(lambda () 
					(vla-copyfrom (vla-item (vla-get-layouts document) layout) (vla-item (vla-get-plotconfigurations document) setup))
				)
			)
		)
	)
	 nil  t  
	)
) ; defun

 

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 8

maratovich
Advisor
Advisor

Maybe this will help you - Revers 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 6 of 8

paullimapa
Mentor
Mentor

I don’t see any feature in your app that addresses the OP


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 7 of 8

maratovich
Advisor
Advisor

@paullimapa  написал (-а):

I don’t see any feature in your app that addresses the OP


You will see when you run the program. If you don't run you won't see anything.
Watch at least the video tutorial.
It automatically assigns all required print options to all layouts.

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 8 of 8

paullimapa
Mentor
Mentor

I watched the video.  Like I said, your app has nothing to do with OP. Go back and read it carefully.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes