Selecting Subcategories in a Template and Families

Hi all,

I am a newbie to Dynamo and I am tying to familiarise myself with Dynamo through my daily work.What I want to do is first making a list of subcategories which set in my template, including default subcatergories, secondly making a list of subcategories used for all families I have been created in the past.
In the future, I might want to make a Dynamo file which replace subcategories one to the other but it will be a long journey for me…
I am hoping someone can help me to create an ideal Dynamo file for my task.

Anyway, I will try to explain what I am asking you to advice.

When it comes to subcategory list for my template I am facing a difficulty to select all elements first.
So do I need to select all categories by adding to item list? Looks so silly…

Even though I can make a list of subcategories in the template, I had faced another obstacle which is selecting used subcategories in each Family.

In the Family Editor, each element can set subcategories, I want to withdraw the identiy date and which subcategories are actually used in the family.

How do I select this information?
Is it type parameter?

And even if I can select the subcategory, will I be able to select them in a template as well or only when I run the Dynamo in Family Editor only?

I would appreciate if you can give me any clues to make a progress to my goal.

Thank you in advance!

Yuki

There’s nodes at least in Data-Shapes and Clockwork that give you a list of all categories. Clockwork also has a node to retrieve the category type (e.g. for filtering out non-model categories). Then there’s the Category.Subcategories node in Clockwork which will get you all subcategories of a given category. And if you want to examine subcategories of actual elements, Clockwork has a node called Element.Geometry+. I think it will, however, only work on placed elements.
Note that in some cases these nodes will return categories as Null values since Dynamo’s implementation of Revit categories is somewhat spotty.

And looking at your screenshot AFTER I posted, I notice you already found one of the nodes I mentioned. :grinning:

Thank you for your comment.
Could you please give me exact name of nodes if you don’t mind?
Since I downloaded both packages, I cannot tell which one you mentioned.
I am so bad at finding nodes…

Thanks.

Yuki

Not in front of a computer right now but I believe the two Clockwork nodes I didn’t mention by name are Document.BuiltInCategories and Category.Type…

Thank you Andreas,

I could extract all subcategories in the end by using a node from a package.
However, I have one thing I am not sure about.

There are two options to select all categories, selecting “categories” by a node “Document.BuiltInCategores” from clockwork and “Revit Categores” by a node “Category list” from Data-shape.
They extract slightly diffrerent categories in my exported list.
image

if you or someone tell how I can correctly use these two nodes , I will appreciate.

Yuki

Here’s a brief explanation from Revit Developer’s Guide: Other Classifications (outdated, but I couldn’t quickly find an equivalent explanation in the 2016 and above guides, and the explanation still applies)

From the developer guide link above in section 5-2:

An element’s category is determined by the Category ID.

Category IDs are represented by the ElementId class.
Imported Category IDs correspond to elements in the document.

  • Most categories are built-in and their IDs are constants stored in ElementIds.
  • Each built-in category ID has a corresponding value in the BuiltInCategory Enumeration. They can be converted to corresponding BuiltInCategory enumerated types.
  • If the category is not built-in, the ID is converted to a null value.

Note: To avoid Globalization problems when using Category.Name, BuiltInCategory is a better choice. Category.Name can be different in different languages.

Here is info to compare BuiltInCategory vs Category from the API docs:
BuiltInCategory Enumeration BuiltInCategory Enumeration

Category Class Category Class

I’m providing these links for you to read rather than an explanation because I’ve found that reading about and understanding the Revit API is much more beneficial in the long run for learning/using Dynamo than just getting an answer on what to do next :slight_smile: Hope this helps!

3 Likes

Hi Andreas, I am looking at the Clockwork component ‘Document.BuiltInCategories’ but can find the built-in category I’m trying to use. I’m specifically trying to get access to Revit Linked Instances which I believe is tied to the category

Autodesk.Revit.DB.BuiltInCategory.OST_RvtLinks

Do you know who developed Clockwork? It would be great to get this component refreshed to include all built-in categories for use in the Dynamo environment. I appreciate all your contributions to the Dynamo community by the way!

The node only shows those categories that are supported by Dynamo.
Accessing link instances can best be accomplished by using the nodes Element Types and All Elements Of Type.

Ok thanks Andreas! For anyone who may find this thread, it was also answered by John over here:

I was able to access the linked instances but now am unable to get any parameter values from elements in those nested links. See image. In short, using 2 different components I am unable to query parameter values of doors. These will ideally be used as a reference to inform what’s happening in the design model. Should I start a new thread to address what might be going wrong?

Notes have been added in the image. The yellow set of 3 nodes is to verify I was typing in the correct parameter name. This was attempted on multiple parameters with no luck.

2 Likes