Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Here is a sample of my code that I am having issues with.
What I want is to split the screen in model space and zoom each window to specific coordinates. But, once I zoom the left window and go to the next window using vla-put-ActiveViewport, the previous vp (left window) zooms out.
Am I missing something? I have seen the UCSFOLLOW suggestion many times and it doesn't help.
(defun c:Example_ActiveViewport()
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Returns current viewport of active document
(setq currViewport (vla-get-ActiveViewport doc))
(setq newViewport (vla-Add viewports "TESTVIEWPORT"))
(vla-put-ActiveViewport doc newViewport)
(setq viewports (vla-get-Viewports doc))
(vlax-for entry viewports
(setq lowerLeft (vlax-safearray->list (vlax-variant-value (vla-get-LowerLeftCorner entry))))
(if (= (nth 0 lowerLeft) 0.000) (setq vp_left entry))
(if (= (nth 0 lowerLeft) 0.500) (setq vp_right entry))
)
(vla-put-ActiveViewport doc vp_left)
(vla-ZoomWindow acadObj (vlax-3d-point 0 0) (vlax-3d-point 100 100))
(vla-put-ActiveViewport doc vp_right)
(vla-ZoomWindow acadObj (vlax-3d-point 1000 1000) (vlax-3d-point 5000 5000))
)
Solved! Go to Solution.