I am trying to create hosted line loads for wall elements through Dynamo, but I have some difficulties. I have tried the method in this thread: “http://dynamobim.org/forums/topic/line-loads-creation-via-python/”, but I would like the line load to follow the analytical wall element - if possible.
I don’t know how to select the hosted line in Dynamo and thereby define a hosted line load.
The challenge here is to find the correct curveIndex. The surfaces boundary curves are stored in a certain order, and you need to find which index the curve you need has. You can use Dynamo for that, in this example I found the index of the line with the largest z-value in the midpoint of the lines.
with this script for finding the boundary curves:
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference('System')
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
element = UnwrapElement(IN[0])
curveloops = element.GetLoops(AnalyticalLoopType.External)
if len(curveloops) < 2:
OUT = [curve.ToProtoType() for curve in curveloops[0]]