# Get and Set Rotation Angle of View on sheet

Hello Dynamo Cummunity

I have 2 identical PlanViews on a sheet, view left has been rotatet.
I would like to rotate view right by the same angle that view left has been rotatet.

After searching the forum i found a python script for rotating views.

It does work, but i donÂ´t understand the input number. For example, if i use input â€ś3â€ť the view will rotate 180Â°.

I also have no idea how i can get the rotation angle of a view.

So i ask for your help and would be really happy about any advice!
Thank you!

Hi @gerhard.p ,

As explained in the post you linked, the difficulty isnâ€™t to rotate the cropbox of a view but to get the rotation of the another view.

Good luck !

Thanks Alban,

So i have to find a workaround to get the rotation angle, in my example that would be to get the â€śrotationâ€ť of the Column.
And then i have to figure out how to set a specific angle to a view.
IÂ´m going to try that in the evening

So itâ€™s possible to retrieve the rotation of the CropBox and set the rotation of another CropBox.
At the same time, I added the section markers and Sectionboxes to my custom node.

4 Likes

Amazing! Looking forward to test it tomorrow and i will post my experiences!
Thank you Alban

Hello Alban,

I did a few tests and it is working fine, thank you so much for your help!

With view.GetCropRegion.Element from Rhythm i should be able to get this to work in one of my scripts!

After more testing i found a problem. The problem is that i donÂ´t get the rotation of a view, what i would like. I get the angle of the cropbox.

Here i have 2 examples of views that have not been rotatet, they have the original orientation of the Project.

In example one i get 0Â° rotation, nice.

In example two, instead of 0Â° i get 64.51

and this leads to the following result when i create a new Planview and try to set the same rotation to it:

What does work perfect is if the view has a rotation:

This view has a rotation and it is applied correctly to another view.

So the problem case is if a view has no rotation, but the cropbox is not horizontalâ€¦it seemsâ€¦

I just figured out what the Problem is.

Before you can read out the Rotation Angle of a view you have to use the function Reset Crop!

Now i just have to find out how to do that in dynamo.

Here you can see a View without a rotation that gives me a â€śfalseâ€ť rotation. After resetting crop i get 0Â° and thats what i want.

https://forum.dynamobim.com/t/how-to-reset-crop-view-using-dynamo/25140/12

1 Like

@MJB-online

Thank you

Now its working perfect

rotation.dyn (16.9 KB)

2 Likes