Jump to content

Recommended Posts

Posted

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

 

Posted

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
Posted (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 by mhupp
Posted

image.png.f5b25f1a52f476f1725dd5c54ec187eb.png

 

I tried but this shows me

Posted

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)

 

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