Jump to content

Recommended Posts

Posted

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

Posted

It did, to some degree. If the page setup already exists, there is no way to error check.

Posted

If there anyway to test to see if a certain page setup is already in the drawing?

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

Posted

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?

Posted

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

Posted

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

  • 3 weeks later...
Posted

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

moz-screenshot.jpg

moz-screenshot-1.jpg clip_image002.jpg

 

 

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