Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3 REPLIES 3
Reply
Message 1 of 4
pklWNF89
448 Views, 3 Replies

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

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

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

Tags (3)
Labels (2)
3 REPLIES 3
Message 2 of 4
bhavik4244
in reply to: pklWNF89

bhavik4244
Collaborator
Collaborator
0 Likes

Message 3 of 4
WCrihfield
in reply to: pklWNF89

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

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)

Message 4 of 4
erichter
in reply to: pklWNF89

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

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)

 

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

Post to forums  

Autodesk Design & Make Report