LISP to Zoom Extents on Drawing Load – Paperspace Only

LISP to Zoom Extents on Drawing Load – Paperspace Only

nrz13
Advisor Advisor
5,576 Views
26 Replies
Message 1 of 27

LISP to Zoom Extents on Drawing Load – Paperspace Only

nrz13
Advisor
Advisor

Does anyone already have a LISP or know how to tell AutoCAD to zoom extents on the current layout if it is a Paperspace layout?  It only needs to be the current layout when opened, since that's the only one the bug affects, but we don't want model space zoomed to extents automatically.

Since it doesn't seem that Autodesk is going to fix the bug it introduced in 2015 with the statusbar loading over the layout, I guess it's time to add a fix to my custom.lsp file.

IF LAYOUT=PAPERSPACE, THEN:
(command "zoom" "extents")(princ))


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Accepted solutions (2)
5,577 Views
26 Replies
Replies (26)
Message 21 of 27

hmsilva
Mentor
Mentor

You're welcome, nrz13!
Glad I could help

Henrique

EESignature

0 Likes
Message 22 of 27

Lineabove
Collaborator
Collaborator

The zoom to extents on opening looks good, but I am not sure after reading the post what lines I should add to my acaddoc.lsp file.

 

Please add a post with the actual lines.

 

0 Likes
Message 23 of 27

nrz13
Advisor
Advisor
Accepted solution

Lineabove:

Just add the following to your acaddoc.lsp file:

; Zoom Paperspace Layout to Extents on Drawing Load (workaround for AutoCAD 2015/2016 Bug)
(if (and (/= 1 (getvar "tilemode"))

         (= 1 (getvar "cvport"))
    )
  (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "_.zoom extents\r"))
)


Work:  AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-8700K, 32GB RAM, Samsung 960 Pro SSD, AMD Radeon Pro WX 5100, 3 Dell Monitors (3840x2160)
Home: AutoCAD 2022.1.3, Windows 10 Pro v22H2 64-bit, Intel Core i7-11700, 64GB RAM, Samsung 980 Pro SSD, NVIDIA Quadro P2200, Dell Monitor (3840x2160)
0 Likes
Message 24 of 27

Lineabove
Collaborator
Collaborator

Thank you.

 

0 Likes
Message 25 of 27

Anonymous
Not applicable

here's one that I found some time ago that will zoom extents all layout tabs and zoom extents the model space...hope it works for you too:)

(defun C:ZA ()
  (foreach lay (layoutlist)
    (setvar 'ctab lay)
    (command "_.pspace" "_.zoom" (getvar 'limmin) (getvar 'limmax))
  ); end foreach
  (setvar 'ctab "Model")
  (command "_.mspace" "_.zoom" "extents" (getvar 'limmin) (getvar 'limmax))
); end defun
Message 26 of 27

pbejse
Mentor
Mentor

5 years man.jpg

 

 

0 Likes
Message 27 of 27

Anonymous
Not applicable

🤣🤣 sorry...just came across this post thought i'd contribute for the next poor sap that comes along!!🤣

0 Likes