I apologize in advance if my question seems basic—I’ve only been learning and using Dynamo for about a week—but I’ve been struggling with this for a couple of hours, even though the operation seems fairly simple.
I have hundreds of identical family instances in a Revit model. These elements are placed at completely different positions (XYZ coordinates) and with different rotations around all the axeses. I need to extract their local coordinate systems to get their vectors for further manipulations inside Revit.
During my research, I found that the “FamilyInstance.GetTransform” node is supposed to provide this information. Unfortunately, this node does not exist in my version of Dynamo. I did find a similar node, “FamilyInstance.Transform”, which takes three inputs:
familyInstance
fromCoordinateSystem
contextCoordinateSystem
However, this isn’t what I need, because I don’t want to perform a transformation; I only want the local origin (which was quite easy to extract) and vector directions of the family instances.
I also tried extracting vectors with FacingOrientation and HandOrientation, but these vectors appear parallel to the world coordinate system, not the local system of the family instances.
For reference, I am using Revit 2024.3 and Dynamo 2.19.3, which may explain the absence of some nodes I’ve seen in online tutorials.
Has anyone successfully extracted the local coordinate system vectors of family instances in these versions? Any guidance or workarounds would be greatly appreciated.
Yes, you’re in the last year and change of functional life on that version so you might be missing some newer nodes which make this easy.
Sadly it’s hard to directly help without a dataset to work off of as how you build the families will matter. Can you post an .rvt with 3 instances in it (an nothing else) so that others don’t have to guess at yoru starting point?
Sure, please, review the file with the sample of the elements (unfortunatelly I have a restriction to add attachments since I’m a new user, so I’m adding a link)
Yes, that’s exactly right. I need these elements to be flexibly rotatable in all directions using parameter values. That’s why the regular families were placed inside adaptive families — since standard Revit families are quite restricted in their ability to rotate freely.
At first glance, it might seem that I could simply use the rotation parameters that define the element’s orientation to also define the local coordinate system. However, in the actual project, the elements are rotated manually in plan view using the classical rotation tool, rather than through parameters.
Additionally, the project itself has a rotated project base point/origin, which introduces extra complications when trying to extract or reconstruct the local coordinate systems of the instances.
You will need to take the rotation of the family instance, then add the instance’s plan rotation, or otherwise extract the geometric data. For what it’s worth this likely would have been easier for both users and data extraction if it were rebuilt as a two point adaptive family (left and right point) which would allow extracting the “orientation” of the reference line between the two point. There are certainly some complexities for what you’re after though, and I don’t want to over simplify things, but consider going back a step as if that makes all the other problems go away, why not take advantage of it?
That said, from the dataset you shared I can see a means of extracting what you’re after as long as your families are modeled in a consistent and aligned way (usually this isn’t the case, so proceed with caution).
Get the Child elements from the adaptive components.
Extract the curves from each of the child elements.
Get the maximum item by length.
Get the coordinate system at parameter 0.
The resulting coordinate system will have the Y axis following the line that runs between the two vertical framing members, a Z axis which is mostly vertical, and an X axis which is seemlingly perpendicular to the assembly.
Thank you! The workflow you described is clear, I’ll test it tomorrow on the actual project and will let you know whether it works (but looks already promising )
The one word of caution in that this method is a house of cards based on how the family you have instances of was built. As that family is updated, one wrong adjustment (i.e. fi the vertical lines are made longer to account for something at the top of the structural assembly) could cause this to fall apart. As such, if this is a firm wide, multiple project workflow, then I recommend revisiting the placement method for the instances. If it’s just for this project, carry on with caution and save out the family library every time it changes.
Apologies for the late response — I’ve just had the chance to return to the task I was working on when I first reached out.
Your solution was extremely helpful! It not only resolved the specific issue I was dealing with but also enabled me to move forward with the subsequent steps of the workflow. One of the intermediate steps involved extracting the endpoint of a line within the family, which your input made really easy.
Fortunately, I have control over the family instances, so I can adjust the line lengths as needed to maintain consistency.