leonucadomi Posted December 21, 2022 Posted December 21, 2022 hello all: I would like to know if there is any routine that you do 1.- Select a 3d solid 2.- rotate in x axis 90 degrees. but that the axis of rotation is the centroid of that solid further every time you "enter" keep rotating 90 degrees until press "scape" help please Quote
BIGAL Posted December 21, 2022 Posted December 21, 2022 You can get centroid its a property of a solid, ; Centroid (RO) = (23136.3 11917.7 25.0) You should be able to use rotate3d using X axis and the centroid point (setq ent (car (entsel "Pick obj"))) (setq pt (vlax-safearray->list (vlax-variant-value (vla-get-centroid (vlax-ename->vla-object ent))))) (command "rotate3d" ent "" "X" pt 90) 1 Quote
mhupp Posted December 22, 2022 Posted December 22, 2022 (edited) (defun C:R3D (/ ent pt t) (setq ent (car (entsel "Pick obj"))) (setq pt (vlax-get (vlax-ename->vla-object ent) 'Centroid)) (repeat 4 ;have to hit esc to exit command (command "rotate3d" ent "" "X" pt 90) (command "//") ) ) Edited December 22, 2022 by mhupp Quote
BIGAL Posted December 23, 2022 Posted December 23, 2022 A different approach. Press ok when happy (defun C:R3D (/ ent pt t) (setq ent (car (entsel "Pick obj"))) (setq pt (vlax-get (vlax-ename->vla-object ent) 'Centroid)) (setq ans 2) (while (> ans 1) (command "rotate3d" ent "" "X" pt 90) (setq ans (acet-ui-message "Correct angle ?" "PLEASE CHOOSE" 1)) ) ) (c:r3d) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.