Did you try it before you posted? Yes. It does
(vla-get-TwistAngle <AcDbViewport object>) returns angle in radians.
Here's the lisp I use it in (to align mleader text with viewport), it does not work with polygonal viewports.
With polygonal viewport I get: "Pick ViewportActiveX Server returned the error: unknown name: TwistAngle"
(defun c:mlv ()
(vl-load-com)
(command "pspace")
(setq vpang (vla-get-twistangle (vlax-ename->vla-object (car (entsel "\nPick Viewport")))))
(command "mspace")
(if
(and
(setq ss (ssget ":L" '((0 . "MULTILEADER"))))
(setq ang (- (* 2 pi) vpang))
)
(repeat
(setq i (sslength ss))
(setq sset (ssname ss (setq i (1- i))))
(vla-put-TextRotation (vlax-ename->vla-object sset) ang)
)
(princ)
)
(princ)
)
Assuming you pick the polyline clipping the viewport, one route to get the viewport twistangle is:
(vla-get-twistangle
(vlax-ename->vla-object
(cdr(assoc 330
(entget
(car(entsel)))))))
The polyline viewport is formed from is hidden in cad, so I could not asume i was picking that.
Thank you sir, it works now!