I’m trying to change the phase filter of a view. I couldn’t find a node for this. So I’m trying to code this.
Here is what I got:
It runs without warning, but nothing has changed in view. There must be something wrong in the code and I can’t figure why.
Thanks in advance.
Edit: I´m really sorry, the preformatted text works depending on something that I have not found yet…so, I´ll have to leave the code as it is for now.
You´re almost there, you just forgot a couple of things:
Unwrap the phase filter too, it is a Revit element as the view.
After the unwraping, you will have to use the transaction manager.
#enable Python support and load DesignScript library
from Autodesk.DesignScript.Geometry import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
#the inputs to this node will be stored as a list in the IN variables.
view = UnwrapElement(IN)
phaseFilter = UnwrapElement(IN)
#place your code below this line
#assign your output to the OUT variable.
Sorry for reviving this thread, will this work with ViewTemplates? I need to change the phase filters in multiple view templates…
I don’t understand phyton code. But since ViewTemplates are views too, i’m thinking if i can wire them to IN