Originally Posted by
wittr
Many objects do not have "rotation" or "scale" variables in the Properties manager. For example, polylines (open or closed).
Also, I want this control for all objects not just inserted Blocks.
Using the Insert point of an object is only an example. Why not use the mid-point of a line or polyline?
Welcome to AUGI, and thanks for clarifying your wish.
I'm not sure that you're understanding how to perform the task you're requesting, and the inherent properties of entities to which you're wanting to apply this functionality.
As example, how would you go about batch rotating multiple Polylines by Midpoint, with Polylines having 3 or more vertices (which Midpoint do you use)?
To help with only _some_ of the functionality you're after, here's a quick LISP that will allow you to batch rotate Arcs, Lines, and Polylines with only 2 vertices, by End, Mid, or Start (the first End):
Code:
(vl-load-com)
(defun c:FOO (/ *error* opt ang acDoc)
(defun *error* (msg)
(if acDoc (vla-endundomark acDoc))
(cond ((not msg)) ; Normal exit
((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit)
((princ (strcat "\n** Error: " msg " ** "))) ; Fatal error, display it
)
(princ)
)
(if
(and
(ssget "_:L"
'((-4 . "<OR")
(-4 . "<AND")(0 . "ARC,LINE")(-4 . "AND>")
(-4 . "<AND")(0 . "LWPOLYLINE")(90 . 2)(-4 . "AND>")
(-4 . "OR>")
)
)
(not (initget 1 "End Mid Start"))
(setq opt (getkword "\nEnter roation point [End/Mid/Start]: "))
(setq ang (getreal "\nEnter rotation angle (in degrees): "))
)
(progn
(vla-startundomark
(setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
)
(vlax-for x (vla-get-activeselectionset acDoc)
(vla-rotate
x
(vlax-3d-point
(cond
((= "End" opt) (vlax-curve-getendpoint x))
((= "Mid" opt)
(vlax-curve-getpointatparam
x
(/ (vlax-curve-getendparam x) 2.)
)
)
(T (vlax-curve-getstartpoint x))
)
)
(* pi (/ ang 180.0)) ; degrees to radians
)
)
)
)
(*error* nil)
)
Cheers