The connectors are also giving me a very different value
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
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.
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
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.
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.