Is it possible to manage controlling Visibility and Graphic Display of Elements Using Filters with dynamo ?
I would like manage patterns properties for my filter.
I’ve written a python script for this which I’m happy to share. Note its pretty simplistic in scope (it only takes one colour and updates projection line colour) - I’m planning on adding this to my package bimorphNodes that will enable greater functionality including list inputs for the new colours (if its not already out there in other packages!). This will get you started at least:
#Copyright 2016. All rights reserved. Bimorph Consultancy LTD, 5 St Johns Lane, London EC1M 4BH www.bimorph.co.uk
#Written by Thomas Mahon @Thomas__Mahon info@bimorph.co.uk package: bimorphNodes
#GitHub: https://github.com/ThomasMahon/bimorphNodes/
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
views = UnwrapElement(IN[0])
newCol = IN[1]
# "Start" the transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for v in views:
filters = v.GetFilters() # Get all the filter ids
for f in filters:
filterObject = v.GetFilterOverrides(f)
col = filterObject.ProjectionLineColor
if col.IsValid:
v.SetFilterOverrides(f, OverrideGraphicSettings().SetProjectionLineColor(Color(newCol[0], newCol[1], newCol[2])))
# "End" the transaction
TransactionManager.Instance.TransactionTaskDone()
Also, can you change the title of your post to relate to your question so others can easily find answers should they have the same question.
Also, check the new filter OOTB nodes and I’ve just found View.OverrideGraphicsSetting in the Archi-lab package by Konrad which may be a better solution: