I am trying to copy selected filters and filter overrides between views and view templates using datashape package, everything seems to be working fine except that the final output of the graph only copy overrides to the first selected filter and not the rest.
Images and graph attached.
Home.dyn (32.1 KB)
Many thanks in advance.
Hmm, the following List@Level changes and addition of View.Filters seems to help.
I cannot speak as to how it would behave with multiple views selected though. That might take some more investigation.
Not sure why in my end it does not work, the node View.SetFilterOverrides only give me one item in the out list.
However when I used the graph you explained us the other day the number of items in the out list is the same as the number of filters you copy across.
I thought it was my dynamo version but it isnt I have tried with 1.3.2 and 1.3.3
Attached both results.
I have modified the lacing to longest and it is working now…
I do not understand why in my end, or why in this graph and not in the other one I have to have a different lacing, is this a glitch???
Many thanks for your support.
I couldn’t get either to work! I wrote my own code… It needs error catching and to work for lists of views, but hopefully it helps others…
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
viewOrig = UnwrapElement(IN)
viewTarg = UnwrapElement(IN)
overrides = 
filters = viewOrig.GetFilters()
filterElemIds = 
for filter in filters:
fel = doc.GetElement(filter)
for filterElemId in filterElemIds:
result = 
count = 0
for filterElemId, override in zip(filterElemIds, overrides):
OUT = result
@Mark.Ackerley I have both copy and retyped your python into my Dynamo script but it seem to be unable to work would you know why?
I’m quite new to Dynamo.
I downloaded your Home.dyn node and tried to apply to my file, in order to copy view filter overrides form one view template to others.
After modifying the lacing to longest as you mentioned,I managed to have it copying filters+overrides from one view template to another.
When it comes to do the same to multiple view templates, it actually copies filter+overrides (pattern and line colors) just to the first one view template, the others just get the filters without the overrides. Is there a way to have it to copy filters with the overrides to multiple view templates at once?
One last thing, in elements.name node it gives me this output (but it works the same): Warning: Internal error, please report: Dereferencing a non-pointer
I attach the node so that you can check it out
Thanks for having shared!
Filters+Overrides OK.dyn (69.4 KB)