I’d like to change the visibility of a filtered list of revisions. The Select Revision Visibility node appears to be the right tool but I’m not sure how it is supposed to be used. See screenshot below. Any ideas?
@Konrad_K_Sobon, I know you’ve done quite a bit with revisions and Dynamo, it’s your blog that got me this far, have you used this node before?
Thanks for the help!
@B_Derrick I believe that the “Select Revision Visibility” node exists to use in conjunction with the OOTB Create Revision by Name node (shown in the top group). Visibility is a property of a Revision, rather than a parameter value (shown in bottom group) so I think you would have to use Python to modify this property.
That makes sense, thanks @awilliams for the reply. The nodes you show with Property Names and Property Values, what package are they from?
They are from the Wombat Dynamo package
@B_Derrick I got curious myself on setting this with Python and have sort of hit a wall with it, but feel free to have a look - I posted it as a separate thread here: Setting Revision Visibility with Python - RevisionVisibility Enumeration Members
@awilliams took a stab at this using Python since there isn’t any OOTB nodes that are capable of what you are asking for. The answer was posted here: Setting Revision Visibility with Python - RevisionVisibility Enumeration Members
Cheers!
Thanks @awilliams and @Konrad_K_Sobon! You are both smarter than me.
I added your python script to my Dynamo and I’m still not seeing any changes. Am I missing something? See attached DYN file.
Can you flatten the list coming from List.FilterByBoolMask
so that it’s just a flat list of Revisions.
I’m only pulling the “out” output (list 1) and not both lists of revisions, as I understand, it is a flattened list.
@B_Derrick Hmm interestingly enough I had just asked @Konrad_K_Sobon about the if isinstance(revisions, list):
line in his code, which I hadn’t tried adding to mine (this post here Setting Revision Visibility with Python - RevisionVisibility Enumeration Members) I just tested out adding that line to my code and it seems that it caused the same output of no changes occurring.
Here is the code that does work for me:
import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import System
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
revisions = UnwrapElement(IN[0])
vis = System.Enum.Parse(Autodesk.Revit.DB.RevisionVisibility, IN[1])
TransactionManager.Instance.EnsureInTransaction(doc)
for r in revisions:
newvis = r.Visibility = vis
TransactionManager.Instance.TransactionTaskDone()
OUT = revisions, [v.Visibility for v in revisions]
Works great, thanks again!