Sub Category Properties

Hi all,
Anyone know how to get all properties of Sub-Category in Family like: Line Weight(Projection, Cut), Line Color, Line Pattern, Material? I would like to get all value and transfer it to another family. Thanks for your help!

I found the Script in Forum can be extract the Properties in Subcategory from @ jmmiller but anyone know how to transfer all the Properties setting to another family document? Thanks.


Here is the Python Script.

import clr
from Autodesk.Revit.DB import *

import Revit

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
cat = UnwrapElement(IN[0])
subcat = cat.SubCategories

listNames = []
listPattern = []
patname = []
listout = []
listpatid = []
lineweight = []
lineweightcut = []

for i in subcat:
name = i.Name
id = i.GetLinePatternId(GraphicsStyleType.Projection)
pat = LinePatternElement.GetLinePattern(doc,id)
weight = i.GetLineWeight(GraphicsStyleType.Projection)
weightcut = i.GetLineWeight(GraphicsStyleType.Cut)

style = i.GetGraphicsStyle(GraphicsStyleType.Projection)

OUT = listout, listNames, listPattern, patname, lineweight, lineweightcut

Not sure Dynamo is required here.

Something to try: Bring all the families you want to equalize into a Revit project started from your template. Set the graphics for new categories. Save out the family library. Use the new library as the family, archiving the old versions. Delete all model elements. Purge the unused families. Save the template to ensure graphic changes are set.

Thanks @JacobSmall, Its useful but that isn’t exactly what I need, I expect use the function Transfer Project Standards via Dynamo, I have 100s family need to apply sub category with properties applied (Lineweight, LineColor, Material).

I have got success transfer with Lineweight and Linepattern but others none. It seem API is not supported it for category.

I have many nodes for families and I have nodes for subcategories as well… this should be doable to combine.

1 Like

Thanks Erik, your package is very beautiful, I usually use it which very helpful for my work, I’d appreciate what you’ve done for that. Unfortunately, it is not match in this case.

So what you are saying is, that I miss something there handles lines!?

I am quite busy at the moment preparing next semester, so I have to postpone all the nice coding challenges to later, but don’t hesitate to put ideas up on my wishlist at GitHub :slight_smile:


There is a node in Genius Loci package to set the SubCategories but it works in the project environment.

1 Like

I was looking for nodes in your package but I cant find the nodes can achieve my goal or I missed some thing? I hope you can make perfect your package in future. Your package is really useful, thanks so much.

Wow, that is nearly total finish my work. Unfortunately, lacking Material and working in Project Eviroment but I will try in Family Project. Thank you very much!

I dont know what you mean? if you have my package, then you should know that you get it at GitHub and not at the package manager!?

anyway using two of my nodes and the combine it with @john_pierson nodes i the Rhythm package…
subcat-line.dyn (10.0 KB)

1 Like

Thanks for your help, Erik. May I ask you do you know anyway to apply the category setting (all setting: line weight, line color, line pattern, material) in one family (blank family) to other families (included model) and overwrite it via Dynamo? Is it able or not? I mean your package have this function?


I tried this one but it isn’t work as I expected, maybe I use wrong. Nothing happened.