Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Rotate3D 90°/-90°

Lukasvop1
Advocate

Rotate3D 90°/-90°

Lukasvop1
Advocate
Advocate

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)

 

 

@komondormrex

0 Likes
Reply
Accepted solutions (1)
641 Views
6 Replies
Replies (6)

hak_vz
Advisor
Advisor

Command rotate3d do this!

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes

CodeDing
Advisor
Advisor

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,

0 Likes

Lukasvop1
Advocate
Advocate

@hak_vz wrote:

Command rotate3d do this!


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".

0 Likes

hak_vz
Advisor
Advisor

@Lukasvop1 

 

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

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes

komondormrex
Advisor
Advisor
Accepted solution

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)
)

 

0 Likes

Lukasvop1
Advocate
Advocate

Absolute perfect, thank you.

0 Likes