Grigs Posted January 16, 2009 Posted January 16, 2009 I have a template (DWT) file that holds all the base page setup layouts we use. I was wondering if there was a way, thru lisp, that could automate this process. Right now I have 4 types, with 2 of them having 3 different sizes. Thanks Quote
ReMark Posted January 16, 2009 Posted January 16, 2009 Check this out (hope it helps): http://www.sonic.net/~odin/lounge/autocad%20tips/page_setups_in_autocad.htm Quote
Grigs Posted January 16, 2009 Author Posted January 16, 2009 It did, to some degree. If the page setup already exists, there is no way to error check. Quote
Grigs Posted January 16, 2009 Author Posted January 16, 2009 If there anyway to test to see if a certain page setup is already in the drawing? Quote
wizman Posted January 17, 2009 Posted January 17, 2009 I have a template (DWT) file that holds all the base page setup layouts we use. I was wondering if there was a way, thru lisp, that could automate this process. Right now I have 4 types, with 2 of them having 3 different sizes. try psetupin If there anyway to test to see if a certain page setup is already in the drawing? (defun psetupexist-p (psetup / pc psetupflag) (vl-load-com) (vlax-for pc (vla-get-plotconfigurations (vla-get-ActiveDocument (vlax-get-acad-object))) (if (= (strcase (vla-get-name pc)) (strcase psetup)) (setq psetupflag T)) ) psetupflag ) to use: (psetupexist-p "psetuptotest") Quote
Grigs Posted January 19, 2009 Author Posted January 19, 2009 Yeah, not sure how to use that. I believe it is Visual Lisp? I'm just using the plain old AutoLisp. It seems to work, all I have to figure out is what to test for (nil, iirc). So if the result of the 'psetupexist-p' routine is nil, then I need to have it load that page setup. If it is 'T', then that setup exists and I can move on and not load that one. Correct? Quote
wizman Posted January 19, 2009 Posted January 19, 2009 yes grigs, you're right, another way if you dont want to test if it exist or not, you can also remove all existing psetups then you can do the loading of the pagesetups from your template: (vl-load-com) (vlax-for pc (vla-get-plotconfigurations (vla-get-ActiveDocument (vlax-get-acad-object))) (vla-delete pc) ) Quote
Grigs Posted January 19, 2009 Author Posted January 19, 2009 That might work alot better. We recently replaced our server and all the previous page setups aren't valid. Other than redefining a new command, is there a way to run a specific lisp routine whenever a new drawing is created? Also, how could you force a specific page setup without going thru the dialog box? BTW, I really appreciate your help Quote
Guest rabs72 Posted February 4, 2009 Posted February 4, 2009 That's the simple part. Put the code into "ACAD.LSP" file that is in the base Folder for ACAD and in the options under the SYSTEM tab the general Options section Has a check box that will load the ACAD.LSP every time you open a drawing. I find it had to reset the system to default every time I ope another drawing. If you can not find ACAD.LSP you can create your self and it will load every time if the opion is checked 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.