- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am in the process of designing an insulation system for various piping configurations. During the development of the code, I encountered an error described as "AttributeError: 'List[Element]' object has no attribute 'Create'". I have attached the relevant code for your review and assistance. Thank you in advance for your support.
TransactionManager.Instance.EnsureInTransaction(doc)
Pipes = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_PipeCurves).WhereElementIsNotElementType().ToElements()
PipeFitting = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_PipeFitting).WhereElementIsNotElementType().ToElements()
PipeInsulaton = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_PipeInsulations).WhereElementIsNotElementType().ToElements()
PipeandFittings = []
for i in Pipes:
PipeandFittings.append(i)
for i in PipeFitting:
PipeandFittings.append(i)
for i in PipeInsulaton:
InsulationType = i.LookupParameter("Type").AsValueString()
if InsulationType == "Condensation":
InsulationTypeId = i.LookupParameter("Type Id").AsValueString()
break
for i in PipeandFittings:
PipeSystem = i.LookupParameter("System Type").AsValueString()
PipeSize = i.LookupParameter("Size").AsValueString()
if PipeSystem == "Air_Steam_High_Pressure":
if PipeSize == "200":
PipeInsulaton.Create(doc,i.Id,InsulationTypeId,50)
TransactionManager.Instance.TransactionTaskDone()
OUT = element
Solved! Go to Solution.