**Edited by moderator. See below the line for original post.
Good morning.
I am trying to access that “BuiltInCategory” name that gives me an error:
name_ele = (elment.Category).BuiltIncategory
but it marks an error…why???
Original post below
Buenos días.
Estoy tratando de acceder a ese nombre de “BuiltInCategory” que me da error:
name_ele = (elment.Category).BuiltIncategory
pero marca error…por que???
Friendly reminder that the official forum language is English. This is a requirement for search to work, otherwise I would only post in swedish to get my practice in.
1 Like
Hard to say what the issue is without some indication of what code you ran. Can you post some Dynamo screenshots and if you’re using Python the code you’re executing using the preformatted text option?
If the text in your question is directly from your code, I see two possible typographical errors (assuming capitalization matters as well):
2 Likes
…and you shouldn’t need the parenthesis.
element.Category.BuiltInCategory
…should suffice, presuming element is a variable containing an Element.
Good afternoon.
Thank you for your comments and answers, but I have tried your recommendations and it did not work… it returns this error…
Have you referenced the Revit API? Probably not.
Look up Dynamo Python Boilerplate. That will probably point you in the right direction.
Really need to see the full code that you are using to reproduce the error. How you retrieve the elements will matter, as will what you import and how you do so.
Hi,
here is an example for all version of Revit (2020 to 2025)
import clr
import System
from System.Collections.Generic import List
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
#linkdocs = [x for x in allsDocs if x.IsLinked]
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument
app = uiapp.Application
sdkNumber = int(app.VersionNumber)
instances = FilteredElementCollector(doc).OfClass(DB.FamilyInstance)
OUT = [System.Enum.GetName(DB.BuiltInCategory, getattr(e.Category.Id, "IntegerValue" if sdkNumber < 2023 else "Value")) for e in instances]
1 Like
yeah seems buitiin is an enumerator…
1 Like
There are many options here, but we can’t help without seeing the full code.
1 Like