Community
Hello,
i'm not getting the expected result with following test code regarding Viewport's Target/Direction:
(defun C:PVPTEST ( / acadObj docObj pSpaceObj ps_centerPt vp_targetPt vp_cameraPt vpObj)
(setq acadObj (vlax-get-acad-object))
(setq docObj (vla-get-ActiveDocument acadObj))
(setq pSpaceObj (vla-get-paperspace docObj))
(setq ps_centerPt (vlax-3d-point (trans (getvar "VIEWCTR") 0 1)))
(setq vp_targetPt (vlax-3d-point '(0.0 0.0 0.0)))
(setq vp_cameraPt (vlax-3d-Point '(0.0 0.0 500.0)))
(setq vpObj (vla-AddPViewport pSpaceObj ps_centerPt 5.0 5.0))
(vla-Display vpObj :vlax-true)
(vla-put-CustomScale vpObj 0.02)
(vla-put-Target vpObj vp_targetPt)
(vla-put-Direction vpObj vp_cameraPt)
)
Resulting viewport should be targeting WCS origin, but I get this instead (Crosshair is on mspace WCS origin):
Same code works fine on other CADs, is there something I'm missing?
Attached you can find test drawing/function.
Thank you for your help.
This is the VBA forum. You want the lisp forum here.
Ok. I thought this was the right forum, since the code is LISP flavor of ActiveX/COM API.
Going there then.