Hi guys, one more tool I need.
This lisp "R90" rotate selected object(s) around axis (define by 2 points) 90° clockwise or counterclockwise.
Direction of rotation is defined by 3-rd point.
Option 1.If it's 3-rd point under rotate object(s) 90° clockwise (90)
Option 2.If it's 3-rd point above rotate object(s) 90° counterclockwise (-90)
Solved! Go to Solution.
Solved by komondormrex. Go to Solution.
Miljenko Hatlak
There's also a (rotate3d ...) lisp that works with the SAME inputs as the ROTATE3D command.
https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-95ECADE6-B791-4B9A-8FAE-CD981F803689
Best,
@hak_vz wrote:
I know, I used it to create this video, which demonstrate required lisp.
I want simplify task, rotate object(s) around axis (defined by 2 points) +90°/-90°.
Eliminate the need enter an angle value.
Like "quick rotate".
It is a simple two liner code using ssgget and autolisp command on rotate3d
Try to write it and ask help if needed.
Sorry, currently have no time to write it for you!
Miljenko Hatlak
hey there,
check the code below. uses grread mouse's buttons though to rotate CCW or CW.
(defun c:rotate_3d_90 (/ target raxis_point_1 raxis_point_2 grread_data total)
(setq target (vlax-ename->vla-object (car (entsel "\nPick object to rotate: ")))
raxis_point_1 (getpoint "\nPick 1st point of rotation axis: ")
raxis_point_2 (getpoint raxis_point_1 "\nPick 2nd point of rotation axis: ")
total 0
)
(while (not (equal '(2 32) (setq grread_data (grread t 12 0))))
(princ (strcat "\r<LMB> rotate +90 (CCW), <RMB> rotate -90 (CW). Total: " (itoa total) " degrees " (cond ((minusp total) "CW") ((zerop total) "") (t "CCW"))))
(cond
((or (= 25 (car grread_data)) (= 11 (car grread_data)))
(vla-rotate3d target (vlax-3d-point raxis_point_1) (vlax-3d-point raxis_point_2) (* +0.5 pi))
(if (>= (setq total (+ +90 total)) +360) (setq total (- total 360)))
)
((= 3 (car grread_data))
(vla-rotate3d target (vlax-3d-point raxis_point_1) (vlax-3d-point raxis_point_2) (* -0.5 pi))
(if (<= (setq total (+ -90 total)) -360) (setq total (+ total 360)))
)
(t)
)
)
(princ)
)
Can't find what you're looking for? Ask the community or share your knowledge.