rotate family with dynamo

Below is a quick overview of a method to create an array of family instances on a curve and rotate them to always be perpendicular to host curve.

You will need to download a few packages to get it to work.

1. Family Transform – extracts Transformation Matrix from family instances. Used to determine angle for rotation.

2. Angle Between Vectors – calculates angle in radians between two vectors. used to determine angle for rotation.

3. Element to ID’s – extracts family instance ID. Used with Rotate Family component.

4. Rotate Family – rotates Revit family instance by a given angle (radians) around given axis (line).

Capture

Capture1

Capture2

There is also a component that I am calling “compare to 90, *1 or *(-1)”. What I am doing there is to compare an angle to 90 degrees and if that angle is smaller it gets multiplied by 1 but if its larger i am multiplying it by -1. I am doing this to compensate for the fact that some tangents on a curve are either in the “negative” or “positive” based on whether a curve is concave or convex. However when measuring an angle between curve tangent and any other angle revit will always give you the smallest angle and never in negative degrees. Here’s a python code for that node. I am not publishing it since it’s a bit of a rough/specific application for this example thus not very useful to others:

Support archi-lab on Patreon!

3 Comments

  1. Tamer Salheen says:

    Hi Konrad,

    I am trying to achieve the family rotation but apparently there are something missing! I appreciate your help in this. I am new to Dynamo and as usual don’t have the sufficient time to dig this properly.
    I am trying to build a tunnel model based on given coordinates for the rings. I’ve created a simplified ring family with parameters for rotation and trying ot feedback the rotation angle from Dynamo by retrieving the angle between two vectors. I’m considering the horizontal angle for the moment and I believe if the horizontal is resolved the vertical will be as well. the rotation will be a given information from site as a list so I am not worrying much about it.

    Appreciate your time and effort in advance.
    Tamer

    Attachment:  Tunnel-Modeling.zip

    • I am sorry, but given my current workload at work I might not be able to look at it anytime soon. I would recommend that you post to the DynamoBIM forum. I am sure there will be plenty of people that have a little bit more time at the moment to help you out. I usually look at the forum when I have some time for things to do so its always a good place to post comments and ask for help. Remember that when you ask me directly you are effectively reaching out to 1 person, but if you post on the forum its like asking 100s of people at the same time. The network has always had a greater capacity than an individual in solving problems like this. Give that a try. Good luck!

Leave a Comment