I try to create a line load on a wall in Revit 2024 using python. But I'm getting an error. I have attached my code and error image below, can anybody help in solving this.
import clr
import Autodesk.Revit.DB
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import LineLoad
doc = __revit__.ActiveUIDocument.Document
all_eq = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType().ToElements()
locCrvs = [] #Create an empty list to store the curves
lLoad = []
t = Transaction(doc, "Transaction Name")
t.Start()
for w in all_eq:
locCrvs = w.Location.Curve
EleID = w.Id
lLoad.append(LineLoad.Create(doc, EleID, locCrvs, XYZ(0,0,-1), XYZ(0,1,0), None))
t.Commit()
and there is a error occur: hostElemId is not permitted for this type of load.
I am using the Create Method in the Revit API Docs to create the line load
(Reference: https://www.revitapidocs.com/2024/6f4e235f-8aed-5f41-6d85-024e556dcb17.htm)
I dont know whether it is the problem of the input of LineLoadType? But i have no idea what should I input for the LineLoadType.