Creating and assigning Sub Categories issue


I am trying to pass a list of geometry to the component family form to create a Revit family.

I have 2 lists, List of geometry and a list of Layer names which I want to use as Sub categories in revit.

The add subcategory node fails if there are same layer names.

Is there a way this node can Add and assign subcategories if they don’t exist and assign subcategories if they already exist?
Maybe another node ( Set Subcategory) that sets the subcategory by feeding in a list?
Is there another way to do this?
Edit - I saw a similar post on this Family SubCategory Unique Name Error - Rhino.Inside / Revit - McNeel Forum

Any updates on that?


If you set the tracking to Enabled:Replace it will overwrite the previously created Sub-Category

or you test to see if the category is there before using Add Sub-Cat

Thanks @Japhy.
Lets say that I checked if a subcategory exists or not using this method, How can I apply my brep geometry to a specific subcategory?

is there a way to format my lists to make this work?
Edit - I am not selecting layers and grabbing all the geometry from them, I am extracting the layer information from the breps and passing it through.
The larger workflow I am trying to establish is to convert a rhino block to a revit family

This will be fixed so that it won’t throw the error and provides the proper category.

Here’s a workaround that tests and creates any missing subcategories. Elefront required.

Re_check and Create (15.1 KB)

The Subcategories will be generated and then be able to be queried properly and applied to the individual breps.

Kinda like so…

Thanks @Japhy . I’ll use this for now and keep an eye out for the update.

@Japhy Has this been updated in the newer releases?
Creating subcategories if they don’t exist , and assigning existing ones if they do exist

Yup! Right Click on the Add Subcategories component and choose either Skip or Continue for the Error Mode.

Thanks @Japhy !