Are you just trying to sort the lines and group by subcategory? Could you not do GroupByKey? Just use the obj to string as the keys and the line element list as list.
I jumped the gun on Subcategories. API will get you them as long as they are curves. I can try in a little bit when I am free, but if anyone else wants to its just the line.Subcategory
So I am giving it a try and first problem is that it is saying subcategories can only be accessed within a family doc, so feeding it your list of lines wouldn’t work. I didn’t expect it to work to begin with since the lines you have are not the Revit family lines but just Dynamo elements based on the curves. Meaning the lines you have selected has no connection to the generic model besides being in the same place, no data or anything.
So instead, you would have to feed it a list of families, open the family docs, select the lines, use the Subcategory method, then return the subcategories.
If you are trying to use this script to filter those lines you see in Dynamo, I don’t think it will work like that.
I dont understand why I can access the lines within a family in a project, but can not get the subcategorie name.
Does an other Idea come into your mind how I could group lines of families within a project? I thought it would be easiest with subcategories. I would need these different lines to go on with my skript…
I am not familiar enough with Revit API to help you, sorry. Maybe someone more knowledgeable can chime in. As for the lines you accessed, what is in the Dynamo viewer are not the lines from the family but just a Dynamo copy of it. It has no data to it so you cannot get the subcategory for it. All it is is the location/curve geometry.
Okay I found out now I can get also all the subcategories of all my generic models.
And I already have all the lines of my generic models. How can I filter the lines by the subcategories?
Edit: You still have the same problem that you don’t know what the subcategory the lines are. The subcategory node just tells you all of the subcategories available to that category.
It seems you’re confused as to what is Revit geometry and what Dynamo geometry and which information is held by what elements…
In any case have you tried looking into this node from Clockwork giving you a list of Dyn-Geometry, Revit-Geometry and sub-Category from elements rather than from Category?