Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

Look into something along the lines of LAYOUTCREATEVIEWPORT in the AutoLISP Developer's Guide.

Posted

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

Posted

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

Posted

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.

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

Posted

ooopps, sorry that's what i get for smoking crack while reading post

well done lee

Posted
that's what i get for smoking crack while reading post

 

Seriously? :o

Posted

About the create viewport on new layouts on options...

 

Command: (getenv "CreateViewports")

"0"

Command: (setenv "CreateViewports" "1")

"1"

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

Posted
Oh, didn't realise it was a registry entry also, thanks Luis :)

 

you are welcome - sir.

Posted

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.

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

Posted

Thanks Lee,

 

I copied down below the create layout line too.

 

Thanks

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

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