Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Kent1Cooper
en respuesta a: Anonymous

So it puts the outline of a selected Viewport's viewed area into Model Space, and you go into the Model Space tab and Zoom to that object, and then erase it?  If the idea is to select a Paper Space Viewport, go into the Model Space tab and Zoom to the area shown in that Viewport, here is a far easier way to do it, that does not involve drawing any temporary object:

(defun C:ZVAM (/ vpdata); = Zoom to Viewport's Area in Model tab
  (setq vpdata (entget (car (entsel "\nSelect Viewport to Zoom to its area in Model Space: "))))
  (setvar 'tilemode 1); into Model Space tab
  (command "_.zoom" "_c" "_none" (cdr (assoc 12 vpdata)) (cdr (assoc 45 vpdata)))
  (princ)
); defun

The 12-code entry in a Viewport's entity data is the center of the view in Model Space units, and the 45-code entry is its height in Model Space.

 

It doesn't verify that you're in paper space when you start, but could be made to, and to verify that you actually selected a Viewport, but first see whether it does what you want when you control for those things.

 

[Curiously, calling for the Center option in Zoom needs to be by that initial letter only -- spelling out  "_cen" or "_center" is taken as an Osnap call, and it doesn't like "_none" in response to that.]

Kent Cooper, AIA