Hi, i try to write program for add insulation in Revit model. Now i want put only one type of insulation and thicknes (user sets type and insulation → in the future) but i don’t know how to work around the error “expected ElementId, got int”. I tried few codes:
a) Plumbing.PipeInsulation.Create(doc,i.ElementId,599323,10) #599323 - insulation type id, 10 - thicknes
b) Plumbing.PipeInsulation.Create(doc,i,599323,10)
c) Plumbing.PipeInsulation.Create(doc,str(i.ElementId),599323,10)
etc. in all ways script doesn’t work because of wrong type of element id input. Thanks for help.
My code:
> import clr
>
> import sys
>
> import os
>
> from rpw import revit
>
> from Autodesk.Revit.UI.Selection import *
>
> from Autodesk.Revit.DB import *
>
> from pyrevit import DB, forms
>
> doc = revit.doc
>
> uidoc = revit.uidoc
>
> # Pick model elements and add insulation
>
> try:
>
> with forms.WarningBar(title="Pick elements in model"):
>
> collector = uidoc.Selection.PickObjects(ObjectType.Element)
>
>
>
> for i in collector:
>
> try:
>
>
>
> Plumbing.PipeInsulation.Create(doc,i.ElementId,599323,10) #599323 - insulation type id, 10 - thicknes
>
> except Exception as e:
>
> print(e)
>
> except Exception as e:
>
> print(e)