TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on February 09, 2012, 11:40:27 AM
-
Hi all,
I'm not able to change the twistview for all layout or a specific one when i'm in model space.
(defun MVrotate (MviewHAndle MVangle)
(vla-put-TwistAngle
(vlax-ename->vla-object (cdr (assoc 330 (entget (handent MviewHAndle)))))
(- (read MVangle))
)
)
Note: the Mview is in fact a closed polyline, that why I use 330 code.
The code seem to work great in PaperSpace.
any help will be appreciated thank you.
also,...this will increase the theswamp database. (see below) :kewl:
-
TwistAngle is a property of a PViewport (= Paperspace Viewport) hence I doubt it will work in Model.
-
for model space
Command: SETVAR Enter variable name or [?] <VIEWTWIST>:
VIEWTWIST = 56 (read only)
-
There we go...
(vlax-for layouts
(vla-get-layouts
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(if (eq (vla-get-modeltype layouts) :vlax-false)
(vlax-for n (vla-get-block layouts)
(if (and
(= (vla-get-objectname n) "AcDbViewport")
(eq (vla-get-handle n) (cdr (assoc 5 (entget (cdr (assoc 330 (entget (handent MviewHAndle))))))))
)
(vla-put-TwistAngle n (- (read MVangle)))
)
)
)
)