Wrapping categories into Dynamo

Hello everyone,

Does anyone know if it’s possible to ‘wrap’ anything else besides actual elements from the Revit API into Dynamo?
I’ve gone through this https://github.com/DynamoDS/Dynamo/wiki/Python-0.6.3-to-0.7.x-Migration but it seems like it’s only possible to wrap actual elements from the API into Dynamo.
Example: I’m trying to get the Categories from Autodesk.Revit.DB.Category into Revit.Elements.Category:

Is this in any way possible? ToDSType only seems to work for actual elements.

I’m facing the same problem. Any help please? :slight_smile:

I took another look at my problem and I found a way to do it:

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
categories = doc.Settings.Categories
listout = []
	
for x in categories:
	listout.append(Revit.Elements.Category.ById(x.Id.IntegerValue))

OUT = listout
4 Likes

Thanks @T_Pover