import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
from Autodesk.Revit.DB import *
from Autodesk.Revit.Creation import *
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
doc = DocumentManager.Instance.CurrentDBDocument
FirstPoint = IN[0]
SecondPoint = IN[1]
level = UnwrapElement(IN[2])
pipeType = UnwrapElement(IN[3])
systemType = UnwrapElement(IN[4])
outpipes = []
# create transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for i,x in enumerate(FirstPoint):
pipe = Autodesk.Revit.DB.Plumbing.Pipe.Create(doc, systemType.Id, pipeType.Id, level.Id, FirstPoint[i].ToXyz(), SecondPoint[i].ToXyz())
outpipes.append(pipe )
TransactionManager.Instance.TransactionTaskDone()
OUT = outpipes
Warning: IronPythonEvaluator.EvaluateIronPythonScript fail。
Traceback (most recent call last):
File “”, line 37, in
AttributeError: ‘List[object]’ object has no attribute ‘Id’
How can I modify the script ?