Custom Template

Hi All,

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.

http://help.autodesk.com/view/RVT/2016/ENU/?guid=GUID-145815E2-5699-40FE-A358-FFC739DB7C46

Thanks for all
:slight_smile:

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.

1 Like

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:

2 Likes

Hi @Remy_Maurcot

Are you looking to set the Projection/Surface patterns colour for view template or just in the standard VG settings?

@Thomas_Mahon thanks for the mention.

@Remy_Maurcot you can do that with the nodes that Thomas has mentioned. Just download the latest Archi-lab grimshaw package.

Cheers!

1 Like

Thanks for all,
I’ll look at it as soon as possible I’m overloaded right now.

@Kulkul
I want set the Projection/Surface patterns colour for view template.

Best,