Setting Rotation from Element Location.Rotation? Door Clearances

Hello all!

I’m attempting to model door clearances with Dynamo. I am having an issue with setting the correct rotation for my door clearance family that I am placing.



image

I’m placing a clearance family at the door location point and attempting to rotate with the angle obtained from the door location property so that the width of the clearance matches the width of the door.

I believe I could solve this, and am attempting to now; however, I feel like the solution I reach will be more complicated than it needs to be.

I have run into similar issues with rotation on other occasions. For example when using AngleAboutAxis node and compare a vector to x or y axis I receive an angle that works for some instances, but others I need to modify the angle by adding 45 or 90 to get my desired rotation angle if that makes sense.

I would love to hear how you guys solve issues such as this one.

Thank you!

Just discovered this from another similar graph which seems to be working

2 Likes

Hi Eric,

Thanks for sharing, I try to learn the python script that you have posted,
however it gave me error , I not sure what gone wrong, would you mind point out my mistake.
below is my screenshot, thank you

You’re missing a capital P in ToPoint().

1 Like

Like @MartinSpence said, I believe you’re just missing the capital P in ToPoint().

Also please note in my updated graph I removed the python script and replaced it with an OOTB node to retrieve the location since I am no longer getting the rotation angle from the python script. I believe it’s “Element.GetLocation”.

Also I see you have the Element.Location+ node, that is a good one to utilize because other elements require different means to retrieve their location and Element.Location+ accounts for that.

1 Like

Thanks @MartinSpence @ericabbott for the advise, just learning bit by bit pyhton script ,
it worked !.. silly me

Have a great day !

1 Like