itacad Posted August 22, 2021 Posted August 22, 2021 Hi I often have to compare files that use the same xref but have different content. I would like to transmit the area I am viewing on the current file, on the other open files (the same zoom window). the goal is to have the area I am comparing ready when I examine the next file. I tried to tile the open files but it is not a solution that helped me. Do you know a lisp that can solve this request? Thanks in advance Quote
tombu Posted August 22, 2021 Posted August 22, 2021 Lots of code out there for importing views from other drawing search Google for "import view AutoLisp" Depending on your workflow if a drawing with saved views was used to create the other drawings they would all have those saved views. 1 Quote
itacad Posted August 22, 2021 Author Posted August 22, 2021 thanks to both of you for the tips! For mhupp: looks just what I need! I'll try it tomorrow! Quote
BIGAL Posted August 23, 2021 Posted August 23, 2021 There are a couple of other ways to get current view settings without out user input. (setq vc (getvar 'viewctr)) (setq sz (getvar 'viewsize)) (vl-propagate 'vc) (vl-propagate 'sz) ; other dwg (command "zoom" "C" vc sz) 1 1 Quote
mhupp Posted August 23, 2021 Posted August 23, 2021 (edited) All in one command. Defaults to "No" so you can just hit enter if you don't want to redefine. was trying to do something with setenv & getenv but you can only save strings. then ran across @pBe propagate 100% simpler. then @BIGAL made it even better! ;;----------------------------------------------------------------------------;; ;; Zoom Area Across Multiple Drawings (defun C:ZA (/ a) (initget "Yes No") (setq a (cond ((getkword "\nRedefine Zoom Area? [Yes/No]: ")) ("No"))) (if (= "Yes" a) (progn (vl-cmdf "_.Zoom" "W" Pause Pause) (setq vc (getvar 'viewctr)) (setq SZ (getvar 'viewsize)) (vl-propagate 'vc) (vl-propagate 'sz) ) (if (or (= vc nil) (= sz nil)) (prompt "\nPlease Define Zoom Area") (vl-cmdf "_.Zoom" "C" VC SZ) ) ) (princ) ) Edited August 23, 2021 by mhupp added error check if vc or sz wasn't set. 1 Quote
BIGAL Posted August 24, 2021 Posted August 24, 2021 Will use propogate in future always learning. You can get the dwg list of all the open dwgs and jump to another dwg, trying to remember about processing commands in new dwg. Need more play time. two dwgs be in 1st dwg which is item 0, will jump to other. So if had multi dwg would need a pop dcl lst to pick dwg name. (setq acDocs (vla-get-documents (vlax-get-acad-object))) (vla-activate (vla-item acdocs 1)) (command "zoom" "C" "356.0,174.0" 300) 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.