Retrieve Visibility Graphic Overrides for View(s)?

Is it possible to retrieve Visibility Graphic Overrides for view(s)? Not graphical overrides of elements in the view but the actual VG overrides. See image below. Through researching on this forum I have been able to locate a block of code provided by @Dimitar_Venkov. It will grab the required information for the category but not the subcategories. I have attempted to modify the code to attempt to also retrieve the information for the subcategories but have been unsuccessful. Any help anyone is willing to provide is always greatly appreciated. Thank you.

VG

@Dimitar_Venkov code:

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

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

cat = UnwrapElement(IN[0])
v1 = UnwrapElement(IN[1])





#Assign your output to the OUT variable.
OUT = cat.GetGraphicsStyle(GraphicsStyleType.Projection), v1.GetCategoryOverrides(cat.Id).ProjectionLinePatternId, v1.GetCategoryOverrides(cat.Id).CutLinePatternId

Hi,

You should check out the “Category.Subcategories” node from Clockwork.

import clr

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

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

cat, subs, v1 = UnwrapElement(IN)

allCats = [cat]
allCats.extend(subs)

OUT = []
for c in allCats:
	data = (
			c.GetGraphicsStyle(GraphicsStyleType.Projection),
			v1.GetCategoryOverrides(c.Id).ProjectionLinePatternId,
			v1.GetCategoryOverrides(c.Id).CutLinePatternId
			)
	OUT.append(data)
1 Like