
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to create a pipe system using Revit Python Shell. My code is:
from Autodesk.Revit.DB.Mechanical import *
a = XYZ(0,0,0)
b = XYZ(100,0,0)
levels = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Levels).WhereElementIsNotElementType().ToElements()
print(levels)
level = levels[1]
print(level)
system = Plumbing.PipeSystemType.DomesticColdWater.GetType
print(system)
pipetype = id(Plumbing.PipeType)
print(pipetype)
t = Transaction(doc, "pipe")
t.Start()
Plumbing.Pipe.Create(doc, id(system), Plumbing.PipeType.Id, level.Id, a, b)
t.Commit()
But when I run I am getting:
Exception : Microsoft.Scripting.ArgumentTypeException: expected ElementId, got int
Anyone help please to create a new element type (pipe type) and get its' id? How can I set a specific dimensions to the pipe I want to creating using script only? thank you!
Solved! Go to Solution.