Rotate3d with reference line

Rotate3d with reference line

james_hough
Explorer Explorer
315 Views
1 Reply
Message 1 of 2

Rotate3d with reference line

james_hough
Explorer
Explorer
Hello,
I am trying to create a rotate3d lisp routine with the ability to rotate an object by defining a base point, a reference angle from a 3d line (or two 3d points), and a new angle defined in the same manner.
Has anybody been down this path before?
0 Likes
316 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Hi james_hough,
Here a sample to create rotate3d in 3d object.

[code]
(defun c:test (/ el1 el2 frad len loc p1 rad)
(command "_vpoint" "r" 275 35 "")
(setq loc '(0 0 0))
(setq rad 3)
(command "_circle" loc rad "")
(setq el1 (entlast))
(setq len 10)
(command "_extrude" el1 "" len 0 "")
(setq el2 (entlast))
(setq p1 (polar loc 0 2.5))
(setq p2 (polar p1 (* pi 0.25) 0.7071))
(setq p3 (polar p2 0 0.5))
(setq p4 (polar p3 (* pi 1.5) 1))
(setq p5 (polar p4 pi 1))
(command "_pline" p1 p2 p3 p4 p5 "c" "")
(setq el3 (entlast))
(if
(not (member "geom3d.arx" (arx)))
(arxload "geom3d")
)
(rotate3d el3 "x" p1 "r" 0 90)
(setq el4 (entlast))
(setq p6 (list (car loc)(cadr loc) 10))
(command "_line" loc p6 "")
(setq el5 (entlast))
(command "_revolve" el4 "" "o" el5 "")
(setq el6 (entlast))
(command "_erase" el5 "")
(command "_subtract" el2 "" el6 "")
(command "_shademode" "g")
(command "_3dorbit")
(princ)
)
[/code]


wrote in message news:5310852@discussion.autodesk.com...
Hello,
I am trying to create a rotate3d lisp routine with the ability to rotate an
object by defining a base point, a reference angle from a 3d line (or two 3d
points), and a new angle defined in the same manner.
Has anybody been down this path before?
0 Likes