[Dynamo] AttributeError: 'pipe' object has no attribute

Can anyone help me? I don’t know what I’m doing wrong

import sys
import clr
clr.AddReference('ProtoGeometry')
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
from Autodesk.DesignScript.Geometry import *
from Autodesk.Revit import *
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

# Coletor dos Tubos:
Tubos = DB.FilteredElementCollector(doc).OfCategory(DB.BuiltInCategory.OST_PipeCurves).WhereElementIsNotElementType().ToElements()

for i in Tubos:
    Dim = i.LookupParameter('Diâmetro')

image

Hi @willian.lemos,

You didn’t define DB anywhere.

Try this instead :

import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

Dim=[]

Tubos = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_PipeCurves).WhereElementIsNotElementType().ToElements()

for i in Tubos:
    Dim.append(i.LookupParameter('Diamètre').AsValueString())

OUT = Dim

1 Like

thanks for replying @Alban_de_Chasteigner !

It’s still not working, I can’t understand why

I think I found out, I believe it’s because of the dynamo update

image