Jump to content

Recommended Posts

Posted

Hello everyone. I'm doing a project that requires only the use of AutoLISP, but since i'm not very experienced with this programm, there's some things that I really don't understand. One of them is how to use the command "3d rotate" in a selected object. I know how to select the object by creating it as an entity, and how to activate the "_.3drotate" command, but I don't know how to select the axis in which I want to rotate my object on. Can someone please help me with this? What's the most simple and basic way to perform a 3D ROTATE in AutoLISP? Thank you very much for your help.

Posted

Do you intend on letting the user choose the axis or do you want to calculate it based on a point, other assumptions etc.?

Posted

the command is rotate3d not 3drotate in my autocad 2006 did it change in newer versions?

anyway just pass any collected information to the command when you call it

Posted

JohnM, the version I'm using currently is 2010. Since I've only started using AutoCAD when it's version was 2008, I'm not really familiar to the changes with the versions before this one.

 

Also, the axis selection information it requires... yeah, I can only normally select it by using the mouse cursor to select an axis from a selection wheel that pops up after picking the objects that I desire to rotate... It doesn't really show a command from which I can guide myself on...

Posted

As Johnm mentioned, check out the command "rotate3d". Both commands are in AutoCAd 2008, I assume 2010 has both also?

 

"rotate3d" looks to be more amenable to Autolisp, with command line options.

  • 2 weeks later...
Posted

There are at least two AutoCAD commands to rotate an object in 3D. One is "rotate3d" the other is "3drotate". I prefer rotate3d as it lets you type in the axis with ease. "3drotate" has a bug. The rotation about the "Y" axis does not follow the right hand rule as is the case with the X, and Z axis. The command Rotate3d works correctly for the X, Y, and Z axes.

 

Here's an easy way to use the command in Autolisp:

(command "rotate3d" "p" "" 2 p1 p2 45)

 

This statement assumes that the object was previously selected so the "p" reselects it. There are other ways to select the object. The 2 indicates that the "2 point" method will be used to define the axis of rotation and p1 and p2 are the two points that have been previously defined in Autolisp. The object will be rotated by 45°.

The following will rotate the object by 60° about the z axis":

(command "rotate3d" "p" "" "z" p1 60)

 

I hope this helps. ~Lee

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