Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Is it possible to control "rotate / absolute angle" in dwg with iLogic?

pklWNF89
Participant

Is it possible to control "rotate / absolute angle" in dwg with iLogic?

pklWNF89
Participant
Participant

Is it possible to control the rotate/absolute angle option with iLogi ?

If yes, how ? 

I'm new to iLogic and coding i general. 

1234.png

0 Likes
Reply
508 Views
3 Replies
Replies (3)

bhavik4244
Collaborator
Collaborator
0 Likes

WCrihfield
Mentor
Mentor

Hi @pklWNF89

Just so you know, the method used in the example that @bhavik4244  pointed out is the main method exposed for use in iLogic, for rotating a drawing view.  If you are confused by the math being used within it, that is because in iLogic, when you supply a general number (without units specifier) that is to be understood as a measurement, iLogic understands its units to be in 'database' units for that type of measurement, instead of whatever units you may currently be using within your active document.  The database units for angle measurements is Radians, and the user in that example was wanting to specify the angle in Degrees units, so he is using math to convert 45 degrees to Radians units, so that the iLogic method will understand it correctly.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

erichter
Advocate
Advocate

You can set an absolute rotation of a drawing view with the code snippet below. Positive angles are counterclockwise, and negative angles are clockwise. Keep in mind that although the angle is "absolute," it is still dependent on the initial orientation of the view cube and can thus differ in 90­° increments.

 

Dim oView As DrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select View")
If oView is Nothing Then Return

Dim Angle As Double = 30
oView.Rotation = Angle*(PI/180)

 

0 Likes