-vports

-vports

nathanwheeler27
Advocate Advocate
591 Views
1 Reply
Message 1 of 2

-vports

nathanwheeler27
Advocate
Advocate

Hi,

I am using the below code to place viewports efficiently. However, when placing several views, this is a bit slow because it still goes into the view to pick the "basept" and "endpt", then leaves the view to set "placement". Undo with this command is slow as well.  Is there a faster way? Maybe with vlisp?

 

(command "-vports" "NEw" "none" basept "none" endpt "" placement) ; Create viewport around selected detail
(command "-vports" "LOCK" "OFF" (entlast) "") ; Unlock viewport

 

Thank you

0 Likes
Accepted solutions (1)
592 Views
1 Reply
Reply (1)
Message 2 of 2

nathanwheeler27
Advocate
Advocate
Accepted solution

Nevermind, I worked it out. So much better...

(setq app (vlax-get-acad-object)
                doc (vla-get-activedocument app))
        (vla-display
            (vla-addpviewport (vla-get-paperspace doc) (vlax-3d-point placement) vpwidth vpheight) ; Create viewport at placement with size to fit detail block
            :vlax-true ; Set active
        )
        (vla-put-mspace doc :vlax-true) ; Enter viewport
        (vla-ZoomWindow app (vlax-3d-point basept) (vlax-3d-point endpt)) ; Zoom to detail block
        (vla-put-mspace doc :vlax-false) ; Leave viewport

 

0 Likes