Jump to content

rotate solid... help


leonucadomi

Recommended Posts

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

 

Link to comment
Share on other sites

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)

 

  • Like 1
Link to comment
Share on other sites

(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 by mhupp
Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...