Jump to content

Recommended Posts

Posted

I am using the following macro:

 

^C^C._ZOOM;_E;._QSAVE;$M=$(if,$(eq,$(getvar,DWGTITLED),0),~);._CLOSE;

 

We are always zooming, setting scale 1 to 1, saving and then closing. Is there anyway to inject "set the scale to 1 to 1" before saving? 

 

Is there a  way to make this happen for all open sheets in the window at one time? no as important as the first question.

Posted

Copied and pasted from my Lisp Library:

 

The first are useful functions to have to hand. For example

"ZA" - Zoom All I use all the time in preference to "Zoom" "All"

"Closer" closes document, no save

"VPScale" sets all viewports to 1:1 scale in that sheet

 

Put together in MyClose at the end. Load them all up and it should be OK

 

;;;;SubFunctions, Useful to have anyway;;;;
;;;;Zooms: ZE - extents, ZA - All, ZO - Object, ZP - Previous
(defun c:ze() ;;Zooms extents, then zooms out 0.95x
  (command "zoom" "e" "zoom" ".95x")(princ)
)
(defun c:za() ;;Zoom all, then zooms out 0.95x
  (command "zoom" "a" "zoom" ".95x")(princ)
)
(defun c:zo() ;;Zoom object
  (command "zoom" "o" "zoom" "0.95x")(princ)
)
(defun c:zp() ;;Zoom previous
  (command "zoom" "p")(princ)
)

;;;;asave: Save Lisp
(defun c:asave( / currentversion saveasversion old)
  (setq vars '("CMDECHO" "FILEDIA"))                           ;;Disable command promts and echo vars
  (setq old (mapcar 'getvar vars))                             ;;Record current vars
  (mapcar 'setvar vars '(0 0))                                 ;; Change vars
  (if (= 1 (getvar "dwgtitled"))(command "qsave"))             ;; EXISTING DRAWING
  (if (= 0 (getvar "dwgtitled")) (COMMAND "_.saveas" "" "~") ) ;;new drawing
  (mapcar 'setvar vars old)                                    ;;reset command prompt and echo
  (princ)
)

;;;;closer: Closes drawing, no save
(defun c:closer( / *doc* opendrawings)
  (if (= dbmod 0)(command ".close"))      ;; Close if drawing is saved
  (if (/= dbmod 0)(command ".close" "y")) ;; Close if drawing is not saved
)

;;;; VPScale: Sets all viewports in sheet to 1:1
(defun c:VPScale ( / MySS scale acount)
  (setq MySS (ssget "_X" '((0 . "VIEWPORT"))))  ;; Select all viewports
  (setq acount 0)                               ;; A counter
  (setq scale 1) ;;1 = 1:1                      ;; Scale to use
  (while (< acount (sslength MySS))             ;; loop through selection set
    (vla-put-customscale (vlax-ename->vla-object (ssname MySS acount)) scale)  ;; Set viewports scales
    (setq acount (+ acount 1))
  ) ; end while
)
;;;;; End sub routines ;;;;;


;;;;Zoom extents, all viewports to 1:1, save, close
(defun C:MyClose ( / LayList CurrentLay Lay)
  (setq LayList (layoutlist))        ;; Get layout List (ACAD 2023+)
  (setq CurrentLay (getvar "ctab"))  ;; Record current layout
  (foreach Lay LayList               ;; Loop through each layout
    (setvar "ctab" Lay)              ;; Change layout
    (c:ZE)                           ;; Run ZE: Zoom Extents (above)
    (c:vpscale)                      ;; Run VPScale, set all viewports to 1:1
  ) ; end foreach                    ;; End loop
  (setvar "ctab" CurrentLay)         ;; Return to previous sheet
  (c:asave)                          ;; Save
  (c:closer)                         ;; Close
)

 

  • Like 1
Posted

I see the viewport scale set to 1:1. My mistake, I should have clarified that I want to set the overall sheet scale to 1:1 and not change the viewports.

 

Thanks for the info. I will work with what you have shown.

  • Like 1
Posted

when on the layout page, we set the scale back to 1:1 with nothing selected so that the x-referenced drawings will show correctly, i.e. dashed lines, hatching, etc. this does not change the scale of the viewports which are sometimes set to 1/4 or 1/8 scale.  on our shortcut commands it says "setup 1:1", not sure if that helps.

 

image.thumb.png.47be553ce5579427705c69324eec680a.png

Posted
7 hours ago, Jared A said:

when on the layout page, we set the scale back to 1:1 with nothing selected so that the x-referenced drawings will show correctly, i.e. dashed lines, hatching, etc.

 

How big is your printer? Sound like you have PSLTSCALE turned off.

  • Like 1
Posted

PSLTSCALE is on, I checked. Our printer will do up to 22x34 but to save paper costs we print 11x17. Our drawings are set for a standard paper size of 22x34. Even when not printing, looking at the sheet shows lines solid when they should be dashed if the paper space isn't set to 1:1.

Posted

I don't recognise the drop down list you have there - might be a setting I don't have turned on - or is that a custom button / macro / LISP (and if so.... are you able to post the details, might be something else going on in the background apart from scale at 1:1)

 

 

 

Is it Annotation scale? (I think variable cannoscale does that) - you can replace:

(vla-put-customscale (vlax-ename->vla-object (ssname MySS acount)) scale) ;; Set viewports scales

line with whatever setting needs changing

Posted

i got it figured out, this is what it is for reference:

 

this used our variables we created years ago. Thank you for your help.

 

^C^C._ZOOM;_E;_fillet;radius;0.0625;chamfera;0.0625;_chamferb;0.0625;dimasz;0.0625;dimcen;0;dimdli;0;dimexe;0.0625;dimexo;0.0625;dimgap;0.0625;dimtxt;0.1;donutid;0;donutod;0.5;gridunit;1,1;hpscale;0.25;hpspace;0.25;ltscale;0.208;offsetdist;1;snapunit;1,1;textsize;0.1;dimclrt;7;limits;0,0;36,24;dimscale;1;_chamfera;0.0625;chamferb;0.0625;dimasz;0.0625;dimcen;0;dimdli;0;dimexe;0.0625;dimexo;0.0625;dimgap;0.0625;dimtxt;0.1;donutid;0;donutod;0.5;gridunit;1,1;hpscale;0.25;hpspace;0.25;ltscale;0.208;offsetdist;1;snapunit;1,1;textsize;0.1;dimclrt;7;limits;0,0;36,24;getvar;dimscale;1;_QSAVE;$M=$(if,$(eq,$(getvar,DWGTITLED),0),~);._CLOSE;

  • Like 1
  • Agree 1
Posted
8 hours ago, Jared A said:

Our printer will do up to 22x34 but to save paper costs we print 11x17.

I was trying to make a very bad dad joke

  • Like 1

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