Line loads creation via python


Hi guys!

I’m trying to get a script, which will create a line load in Revit. I’ve searched a lot in the API documentation, but I dont get C# examples and I got stuck with the AnalyticalLinkType.
Could somebody help me out with this or at least tell me if I’m going the right way? Here is what I’ve made:



Revit Line loads through Dynamo
Revit line load with c#

Hi Pawel,

have a look at the following example:


Thanks a lot for your respond Dimitar! I’ll give it a try as soon as possible!


Well, the script works just fine for beams.

But when I change the input for walls, or curves/lines, it always prompts for an analytical model stick

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “<string>”, line 33, in <module>
TypeError: expected AnalyticalModelStick, got AnalyticalModelSurface

I cant find in the API a creation method, as it creates a lineload directly in Revit by selecting two points


Ok, I think I got it. Thanks again for help.


Yes, as you’ve figured out, you can just use the host-less method. But keep in mind that that line load element will not follow your beams and walls. I suggest something along the lines of this:


Yep, works just perfect! Thanks a lot!