Jump to content

Recommended Posts

Posted

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

 

 

Posted

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.

  • Like 1
Posted

thanks to both of you for the tips!

For mhupp: looks just what I need! I'll try it tomorrow!

Posted

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)

 

  • Like 1
  • Thanks 1
Posted (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 by mhupp
added error check if vc or sz wasn't set.
  • Like 1
Posted

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)

 

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