View Full Version : How to add page setups using lisp?
GreyHippo
2004-11-04, 05:57 PM
Is there a way to write a routine that would import page setups into a current dwg.
Thanks
Mike.Perry
2004-11-04, 06:54 PM
Hi
Have a search through the Forums, you should find a lot of information on this subject -
Search Forums (http://forums.augi.com/search.php?)
To get you going in the right direction have a browse of the following thread (look out for references to Ed Jobe's Page Setup Routines) -
Is there any replacement for BatchPlot in Autocad 04 and 05? (http://forums.augi.com/showthread.php?t=4846)
Have a good one, Mike
kennet.sjoberg
2004-11-04, 10:00 PM
Create a new empty drawing and add all Your pagesetup in to it, ex. PsetupName1 PsetupName2. . .
save the "psetup.dwg" in Your company "acad folder". Then use lisp :
(command "psetupin" "psetup.dwg" PsetupName1 ) ; or
(command "psetupin" "psetup.dwg" PsetupName1 "Y" ) ; if exist and You have to redefine.
: ) Happy Computing !
kennet
autocadinstructor
2005-02-17, 04:33 AM
I normally clear out the page Setups and then use your method to get my standard page setups... having the following load and then call DAPS prior to your PSETUPIN routine:
;Save the following to a file DAPS.LSP
;in a searchable path for AutoCAD
;and then APPLOAD it in or include it
;in your ACAD2000DOC.LSP so it
;loads or autoloads
(defun c:daps ()
(vl-load-com)
(vlax-for ps (vla-get-plotconfigurations
(vla-get-activedocument
(vlax-get-acad-object)))
(vla-delete ps)
)
)
kennet.sjoberg
2005-02-17, 02:46 PM
Great to clear out, but how do You import more than only the standard page setup ?
Is there a way to write a routine that would import page setups into a current dwg.
Don't You have to use psetupin ?
: ) Happy Computing !
kennet
CAB2k
2005-02-17, 03:10 PM
I just use this button
^C^CDel_Pagesetups;^C^C.-PSETUPIN "PageSetups.dwg" "*"
and this lisp
;; Function to delete all user plot set ups
(defun c:Del_Pagesetups (/ curdwg pslayout x)
(vl-load-com)
(setq
curdwg (vla-get-ActiveDocument (vlax-get-Acad-Object))
pslayout (vla-get-Layout (vla-get-PaperSpace curdwg))
) ;_ end of setq
;; Call RefreshPlotDeviceInfo before GetPlotDeviceNames
(vla-RefreshPlotDeviceInfo pslayout)
(vlax-for x (vla-get-Plotconfigurations curdwg)
(vla-delete x)
) ;_ end of vlax-for
) ; End Plot_config_list
and a drawing with my setups in it.
kennet.sjoberg
2005-02-17, 03:33 PM
OK, so the key is still the Command "psetupin"
: ) Happy Computing !
kennet
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.