# Revit Line loads through Dynamo

**URL:** <https://forum.dynamobim.com/t/revit-line-loads-through-dynamo/6930>\
**Category:** Revit\
**Created:** [October 20, 2016, 11:28am UTC](https://forum.dynamobim.com/t/revit-line-loads-through-dynamo/6930 "2016-10-20T11:28:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [October 20, 2016, 6:04pm UTC](https://forum.dynamobim.com/t/revit-line-loads-through-dynamo/6930/2 "2016-10-20T18:04:14Z")

</div>

Hei Anders,

You have to use this metohod: [http://www.revitapidocs.com/2017/2e299798-26c8-9e42-47de-d496151d1e3d.htm](http://www.revitapidocs.com/2017/2e299798-26c8-9e42-47de-d496151d1e3d.htm)

C#:

```
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.  
 ![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/6/6fddb61fb7d6b5ff0ef759faa6adb89bf82cc427.png)

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]]
```

---

_[View the full topic](https://forum.dynamobim.com/t/revit-line-loads-through-dynamo/6930)._
