Fabrication Part Element Location Script


Has anyone have any idea of how can i retrieve the xyz position of this particular point in the Fabrication parts fittings?

Have been searching for about two weeks now and have hit a dead end without any sucess.

Would apreciate any direction as i have no clue were to go next.

Hi @Nascimento something here ? get location is from OpenMep and work on fabrication

1 Like

I was trying to get the coordinate of this point, its the intersection of the Fabrication fitting connectors.

But for me at least the Element.GetLocation node was not working

I couldnt find the OpenMEP Package

try here

1 Like

I was able to get the node to work, thanks very much.

image
For some reason i am getting a very different xy value from the one in the project


The connectors are also giving me a very different value

image
Do you think this is related to units? Because i am trying to convert so see if the values make some sense and can’t find why its giving me those values

Did the test while using a regular revit fitting in the middle of the selection and it gave me the correct XYZ for the revit fitting only.

While the fabrication fitting still give me incorrect values for some reason


The revit fitting is the one with index 4

Actually you can visualize location of connector to check
https://chuongmep.github.io/OpenMEP/api/OpenMEPRevit.ConnectorManager.Connector.html?#OpenMEPRevit_ConnectorManager_Connector_Display_Autodesk_Revit_DB_Connector_System_Double_

Connector.Display

2 Likes

The connector XYZ is correct, the issue is the Element.GetLocation that is not able to get the Origin from the fabrication part fitting.

I am searching but can’t find a node that would help me get that Origin value, so maybe python will, trying to learn a little so i can extract that value.

Does anyone have a clue on how to get a parameter from fabrication parts? using python?

Did you find a solution to this?

It fixed in this post :slight_smile:

Yes and no. chuongmep fix could get the xyz for the fabrication connectors, but i was not able to get the origin point that was what i was interested in the beggining.
I tried using python but had no sucess on this endevour on getting that specific point XYZ, if i get some update on the future ill let you know here

I think you need to look at this property of the fabrication part class Autodesk.Revit.DB FabricationPart

I suppose most of revit model elements have the property Location but the fabrication parts have this other property which is just a point, not a line or or sketch as other revit elements have.
you can try something like this in python node, feed IN[0] as a list of fabrication part elements.

# Import the necessary CLR namespaces
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
clr.AddReference('ProtoGeometry')
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from Autodesk.DesignScript.Geometry import Point

# Initialize a list to store messages for debugging or information
messages = []

# Assuming IN[0] is a list of model elements directly
elements = IN[0]  # This is your input list of model elements

# Initialize a list to store the Dynamo Points for FabricationParts or None for other elements
elementsPoints = []

# Iterate over each element in the input list
for element in elements:
    # Initialize the point as None for each element
    point = None
    
    # Check if the element is a FabricationPart
    if isinstance(element, FabricationPart):
        try:
            # Access the Origin property of the FabricationPart
            originXYZ = element.Origin
            # Convert Revit XYZ to Dynamo Point
            point = Point.ByCoordinates(originXYZ.X, originXYZ.Y, originXYZ.Z)
        except Exception as e:
            # Collect error messages
            errorMessage = "Error converting Origin to Dynamo Point for FabricationPart ID: {0}. Error: {1}".format(element.Id, str(e))
            messages.append(errorMessage)
    
    # Append the Dynamo Point (or None) to the list
    elementsPoints.append(point)

# Set the output, including any messages
OUT = elementsPoints#, messages

Don’t know why, may be you need update latest version OpenMEP. Code updated here last year, you can quick review or rewrite with python script : OpenMEP/OpenMEPRevit/Element/Element.cs at 4f05cc60dedba557c2984eabffe05f8540d368cd · chuongmep/OpenMEP · GitHub

1 Like

I wonder if maybe we are talking two different sets of information. We aren’t looking for the connectors but instead the mid point of a fitting. this point is where the two centerlines of the adjoining pipes would intersect if extended through the fitting.

I see where your nodes return the connector origins, but not this point. I have tried backing into this information with vectors, planes, etc. and it isn’t working out. Short of writing a script in C# (not my expertise) I am wondering if Dynamo and Python can make this work.

Maybe the work around isn’t to use the fittings but instead the pipes and look for the intersections of their geometry.

Yea, this is what i been looking for.
I have tried extracting the value using python but so far no sucess.
If i manage to suceed ill post the script on this thread.

In Dev - LytPnt 90 elbow - Single Select.dyn (48.9 KB)

Is this more of what you are looking for also? Now to make this into something usable for my scenario and with selecting multiple elements at a time.

yes, something like that. i also need to select multiple elements.
From all fittings type.

I have added a sequence and pointed it to the z axis of the connectors. this seems to work for 90’s, but it seems that other fittings work slightly differently. This will become a quite complex dynamo script if kept in dynamo.

Just wanted to check back and see if you came up with a solution for your specific issue. I think I have mine all worked out.