Window orientation based on true north


I wish to automaticly fill in a parameter for windows wich says: orientation = North, North-west, west, etc…

I added the parameter as shared parameter, now I wish to fill it with Dynamo.

My idea was to create a vector from the window and measure the angle to true north, if between certain value’s set parameter of window…

I found this post: If ( then , else) in dynamo

Here they showed a Code block for the last part, but I have troubles enough determinating the angle to true north xD

Here is my script and picture of it (wat I got so far):

Orientatie ramen bepalen.dyn (12.7 KB)

I think I managed to get vector from Windows, now i need to get a vector to true north. Then measure the angle between them and use those results to set parameter for oriëntation.

Any help would be apreciated!

PS. Is it posible to add the “Angle to True North” Parameter to the windows? This would make things a lot easier. I tried adding a shared and project parameter with that name but it wont fill the parameter automaticly like it does at base point.


Ok, so I got my script working. There’s just one thing I dont like.

I’m selecting the base point manualy, is there a way to make this go automatically? I tried the following:

but it wont accept the input somehow. Is it because its in a list? And if so, how do i change it?

Here is the dynamo file so for:

Orientatie ramen bepalen.dyn (14.2 KB)


Your assumption about it being a list is probably right. Try putting a code block with “x[0]” after the watch node to get the actual basepoint and not the list.


Hey Taco, thnx for the reply!

I just solved it myself. I had to put lacing on longest in the: “Vector.AngleAboutAxis” Node. :nerd:


l.rozendaal, would you be able to uplaod your updated script? I cant figure out how you got the last point you mentioned working


Here is the file Brian.

Haven’t used it for a year, hope it works.

Not sure wich Packages I used. But this is a screen shot of the packages I have installed atm:

Good luck!


Orientatie ramen bepalen.dyn (18.4 KB)