Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
I'm searching for a way that will automatically open model space and zoom to an object in the selected paper space viewport.
For example, while viewing the drawing in the layout tab, I press a command and select any viewport. It will automatically switch to the model tab and zoom the screen to the correct position, similar to the viewport's view.
It's similar to Leemac's Viewport Outline lisp, but instead of creating a polyline, it zooms through the model onto that object
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
Could be as simple as doing the following:
Go inside the pspace Vport
Use View command to save current model space view position with unique name
Change Tilemode to 1 to go to Model tab
Use View command to restore or set current the saved view & Delete the saved view name
Do you use LIMMIN and LIMMAX? Is LIMITS turned Off?
Since we do not use LIMITS, I use these variables to define zoom window corners.
defun c:ZZR to redefine these variables (getpoint and getcorner).
The values will be stored in the drawing.
Use ZZR while in modelspace.
defun c:ZZZ to automatically zoom "Window" (getvar "LIMMIN") (getvar "LIMMAX") into the area.
Entering into a viewport is up to you.
Hope this helps.
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
@ancrayzy wrote:
....
For example, while viewing the drawing in the layout tab, I press a command and select any viewport. It will automatically switch to the model tab and zoom the screen to the correct position, similar to the viewport's view.
....
It took some trial and error to figure it out, but I think this does what you're after:
(defun C:ZVAM ; = Zoom to Viewport Area in Model space
(/ vp vpdata)
(setvar 'tilemode 0); ensure in Paper Space layout
(command "_.pspace"); and not in Model Space via a Viewport
(setq
vp (car (entsel "\nSelect Viewport by its boundary: "))
vpdata (entget vp)
)
(setvar 'tilemode 1); force to Model Space, not via a Viewport
(command "_.zoom" "_c" (trans (cdr (assoc 12 vpdata)) 2 0) (cdr (assoc 45 vpdata)))
(prin1)
)
It could be improved upon, particularly to check whether what you selected is, in fact, a Viewport, but also with other little things like command-echo suppression and/or Undo begin/end wrapping. But first see whether it fits your description.
Glad you like it. It occurs to me to wonder -- would you ever not be in the World Coordinate System in Model Space when you use this? I'd have to experiment, but it may be that the (trans) function for the Zoom center point should end with ... 2 1) instead of 0, to translate from Display to current-UCS coordinates.
Hi Kent in our civil plans we would use multiple UCS as we walk along a road so road is shown horizontal in a layout, sometimes we would not reset the world UCS in Model. It would be like last view direction used. So may need the Current UCS if setting view. Not sure though if it would be twisted, but zoom C should still work. Have a look at image, red rectangs are layout views.
Can't find what you're looking for? Ask the community or share your knowledge.