Visual Basic Customization

Visual Basic Customization

Posts: 23
Registered: ‎02-25-2003
Message 1 of 2 (64 Views)


64 Views, 1 Replies
10-15-2002 01:28 AM
How can i find the rotation of an entity from the WCS, if it's Rotation property is based on the OCS? I don't have any points that can be used for calculations, just an entity in a selection set.
Active Member
Posts: 6
Registered: ‎10-15-2002
Message 2 of 2 (64 Views)

Re: OCS to WCS

10-15-2002 05:08 AM in reply to: Jluker
I have worked with blocks placed in 3D space.

The simple one is the rotation in xy plan,- when rotatet around the y-axis. You can calculate it from the .normal like this.

Private Function xyRotation(objAcad As AcadObject) As Double
Dim ZeroP(0 To 2) As Double

ZeroP(0) = 0#
ZeroP(1) = 0#
ZeroP(2) = 0#

xyRotation = ThisDrawing.Utility.AngleFromXAxis(ZeroP, objAcad.Normal)

End Function

With the rotation around the y-axisI have some difficulty. Right now I calculate it via good old Phytagoras, the normal forms an triangle equal to the one that is formed by the WCS plan and the xdirection, but this only works if the object is not rotated around the x axis, I think that you can read the rotation in space from the .rotation property but I have to figure out how.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!