
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to see if it is possible to get connected framing elements through the api. My end goal is to be able select a beam and be able to retrieve the elementId of the elements the ends are framing into.
I have been able to do this by checking location intersection of all other beams, but this scales by n^2 based on the number of beams for the check.
I read this post: http://thebuildingcoder.typepad.com/blog/2011/01/finding-connected-structural-elements.html. But I'm confused on the actual implementation of it. Has anybody come across a working example of GetAnalyticalModelSupports(). I'm not sure if what objects have this property since they all seem to inherit it. Or am I missing an import?
I'm working in Python. Here is the code so far:
import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * # Import RevitAPI clr.AddReference('RevitAPI') import Autodesk from Autodesk.Revit.DB import * # Import ToDSType(bool) extension method clr.AddReference('RevitNodes') import Revit clr.ImportExtensions(Revit.Elements) from Autodesk.Revit.DB.Structure import * #The inputs to this node will be stored as a list in the IN variables. dataEnteringNode = IN if isinstance(IN[0], list): elements = [UnwrapElement(i) for i in IN[0]] else: elements = [UnwrapElement(IN[0])] AnalyticalEl = [element.GetAnalyticalModel() for element in elements] #Assign your output to the OUT variable. OUT = AnalyticalEl;
Thanks so much for any help you can give.
Solved! Go to Solution.