Detail Item geometry

Hello everyone,

I was wondering if I can get the geometry of a detail item into dynamo? attached a photo of the detail item where I need to get the line of this detail item.

detail%20item

if I recall, you can’t get it for instances but you can for the family type. Note that this will not have any geometry mutations due to instance parameter value changes, not will it be in the correct location, so you will have to apply the instance mutations and the transforms acordingly.

If that sounds difficult, it’s because it is.

A better solution in your case may be to get the element’s location, and assuming you have a line based element, you should get the resulting line as desired.

1 Like

Thank you Jacob, I solved the problem by getting the element location as a point then get local axes of the element as vectors, by point, vector and distance I got the line finally

I was trying to solve this problem recently (get all line geometry from a detail component) and managed to rig up a Python script that does the job.

import clr
import sys

# Import DocumentManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

# Import RevitAPI
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *

#Add list object
from System.Collections.Generic import List

#The inputs to this node will be stored as a list in the IN variables.
familyInstance = UnwrapElement(IN[0])
view = UnwrapElement(IN[1])

doc = DocumentManager.Instance.CurrentDBDocument 

geomOptions = Options()
geomOptions.View = view

geomInstanceLists = []

# Get geometry elements from families
for instance in familyInstance:
    geomElement = instance.get_Geometry(geomOptions)
    # Break geometry elements into their individual geometry pieces
    for geomObj in geomElement:
        if isinstance(geomObj, GeometryInstance):
            geomInstanceLists.append(geomObj.GetInstanceGeometry())

# Convert each list of geometry pieces to Dynamo line types
dynamoLineLists = []
for geomList in geomInstanceLists:
    dynamoLines = []
    for geom in geomList:
        if geom.GetType().ToString() == "Autodesk.Revit.DB.Line":
            dynamoLines.append(geom.ToProtoType())
    dynamoLineLists.append(dynamoLines)
    
#Assign your output to the OUT variable.
OUT = dynamoLineLists

We can use get symbolic lines from genius loci or sparrow as well :wink:

Thanks, that would have saved a bit of time!

1 Like