woodman78 Posted January 14, 2010 Posted January 14, 2010 I have written a lisp to create a new blank layout that we need sometimes to fool the drawing number if it doesn't start at 1. This is what I have. Can it be created without a viewport or the viewport be deleted? Does the viewport add to the drawing size or should i just leave it there? (defun c:blanktemp () (command "_-layout" "n" "Blank - Do Not Delete") (princ) ) Quote
JohnM Posted January 14, 2010 Posted January 14, 2010 Go to the tools menu then options then to the display tab and uncheck “cerate viewport in new layout” Any object added to a drawing increases file size. If the viewport is not a problem then I would not worry about it. Quote
woodman78 Posted January 14, 2010 Author Posted January 14, 2010 Is there a variable to set this that I can turn it off at the start of the lisp and then back on when I'm finished bringing in the blank template? Thanks Quote
NBC Posted January 14, 2010 Posted January 14, 2010 Look into something along the lines of LAYOUTCREATEVIEWPORT in the AutoLISP Developer's Guide. Quote
JohnM Posted January 14, 2010 Posted January 14, 2010 there is no variable to turn off the make vp on new layouts it must be don in the oiptions dialog box. so here is some code to play with. put it after you code that makes the new vp if the make vp option is on the last entity made when you make a new layout tab is the viewport. code: 1.get the last entity 2. get its information 3. see if its a viewport 4. chect to see if its on the new tab named "do not delete" 5. if it is a vp and on the right tab delete it (setq lent (entlast));_get last entity (setq vpinfo (entget lent));_ent information (setq isvp (cdr(assoc 0 vpinfo)));_see if viewport (setq cortab (strcase(cdr(assoc 410 vpinfo))));_see if it's on the right tab (if (and(= isvp "VIEWPORT")(= cortab "DO NOT DELETE")) (entdel lent);_delete last ent if new vp );_if Quote
Lee Mac Posted January 14, 2010 Posted January 14, 2010 How about: (defun VCreateTog nil (setq *disp* (cond (*disp*) ((vla-get-display (vla-get-preferences (vlax-get-acad-object)))))) (vlax-put *disp* 'LayoutCreateViewport (~ (vlax-get *disp* 'LayoutCreateViewport)))) Quote
JohnM Posted January 14, 2010 Posted January 14, 2010 lee, that works also but i think if you have the "make vp option" checked in the options dialog box it will make a viewport window as well. Quote
Lee Mac Posted January 14, 2010 Posted January 14, 2010 lee,that works also but i think if you have the "make vp option" checked in the options dialog box it will make a viewport window as well. John, My code changes that option in the Options Dialog. Quote
JohnM Posted January 14, 2010 Posted January 14, 2010 ooopps, sorry that's what i get for smoking crack while reading post well done lee Quote
Lee Mac Posted January 14, 2010 Posted January 14, 2010 that's what i get for smoking crack while reading post Seriously? Quote
LEsq Posted January 14, 2010 Posted January 14, 2010 About the create viewport on new layouts on options... Command: (getenv "CreateViewports") "0" Command: (setenv "CreateViewports" "1") "1" Quote
Lee Mac Posted January 14, 2010 Posted January 14, 2010 About the create viewport on new layouts on options... Command: (getenv "CreateViewports") "0" Command: (setenv "CreateViewports" "1") "1" Oh, didn't realise it was a registry entry also, thanks Luis Quote
LEsq Posted January 14, 2010 Posted January 14, 2010 Oh, didn't realise it was a registry entry also, thanks Luis you are welcome - sir. Quote
woodman78 Posted January 15, 2010 Author Posted January 15, 2010 Lee, Your version turns off the make vp option but does it turn it back on again? Just because i don't want to make any change that might throw some people off a bit. Quote
Lee Mac Posted January 15, 2010 Posted January 15, 2010 Lee, Your version turns off the make vp option but does it turn it back on again? Just because i don't want to make any change that might throw some people off a bit. Its a toggle Woodman Quote
woodman78 Posted January 15, 2010 Author Posted January 15, 2010 Thanks Lee, I copied down below the create layout line too. Thanks Quote
Lee Mac Posted January 15, 2010 Posted January 15, 2010 Thanks Lee, I copied down below the create layout line too. Thanks Just keep it as a Sub-Function, and call it twice in your routine. 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.