.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Howto: Set the CurrentUCS from UCSTableRecord ?

1 REPLY 1
Reply
Message 1 of 2
mario.rosenbohm
300 Views, 1 Reply

Howto: Set the CurrentUCS from UCSTableRecord ?

Hello,

how can i set the CurrentUCS from a UCSTableRecord, or by named.
With code for .Net

regards
Mario
1 REPLY 1
Message 2 of 2

maybe this is overkill but...

Public Sub UCStoFrontDirection()
'if my building rotates so does my front direction
Dim x As Double = 0
Dim y As Double = 0
Select Case FrontDirection
Case 0
'nothing to do
Case 0 To 0.5 * Math.PI
y = Math.Sin(FrontDirection * 180 / Math.PI)
x = Math.Cos(FrontDirection * 180 / Math.PI)
Case 0.5 * Math.PI To Math.PI
y = Math.Cos((FrontDirection * 180 / Math.PI) - 90)
x = -Math.Sin((FrontDirection * 180 / Math.PI) - 90)
Case Math.PI To 1.5 * Math.PI
x = -Math.Cos((FrontDirection * 180 / Math.PI) - 180)
y = -Math.Sin((FrontDirection * 180 / Math.PI) - 180)
Case 1.5 * Math.PI To 2 * Math.PI
x = Math.Sin((FrontDirection * 180 / Math.PI) - 270)
y = -Math.Cos((FrontDirection * 180 / Math.PI) - 270)
End Select
ed.CurrentUserCoordinateSystem = Matrix3d.WorldToPlane(New Vector3d(x, y, 1))
End Sub

The key line is the bottom one, ed(editor).CurrentUserCoordianteSystem

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost