Revit Line loads through Dynamo


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: “”, 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.

Regards Anders

Hei Anders,

You have to use this metohod:


public static LineLoad Create(
	Document aDoc,
	AnalyticalModelSurface host,
	int curveIndex,
	XYZ forceVector1,
	XYZ momentVector1,
	LineLoadType symbol

In python you can do something like this:

LineLoad.Create( aDoc,host, curveIndex, forceVector1, momentVector1, symbol)

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

from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

from System.Collections.Generic import List

import Revit

element = UnwrapElement(IN[0])

curveloops = element.GetLoops(AnalyticalLoopType.External)

if len(curveloops) < 2:
	OUT = [curve.ToProtoType() for curve in curveloops[0]]

Hi Einar

Thank you for the help, this was exactly what I needed.

No problem! It would be nice if you share the end result when you make it work and mark it as resolved.

I got it to work!

Here is a simple example

Again thanks for the help!

1 Like

You can find a similar topic here: