I tried looking through your github page but can’t find what I am looking for. Has this node been deprecated? If so, is there a replacement?
could help and you can download also the previous version of the package
You can download the old package and extract the Python script. Although, I would advise being on the latest version of Rhythm if possible.
I dropped that node for a few reasons,
-
It’s a
.DYF
custom node. I am working on removing these from the package completely and being 100% ZeroTouch C# nodes. -
The method changed in the Revit 2019 API from
PostableCommand.CloseHiddenWindows
toPostableCommand.CloseInactiveViews
. So rather than rebuild the logic, I dropped it.
That being said, this Python script should work for you.
import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
app = DocumentManager.Instance.CurrentUIApplication.Application
uiapp = DocumentManager.Instance.CurrentUIApplication
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *
# output a result
output = []
# find out version number of Revit
if int(app.VersionNumber) > 2017: fullVersion = app.SubVersionNumber
else: fullVersion = str(app.VersionNumber)
# if it is 2019, we need to use the new method
if fullVersion.Contains("2019"):
pCmd = RevitCommandId.LookupPostableCommandId(PostableCommand.CloseInactiveViews)
# other versions use the old method
else:
pCmd = RevitCommandId.LookupPostableCommandId(PostableCommand.CloseHiddenWindows)
# runs if true is fed into the node
if IN[0] == True:
uiapp.PostCommand(pCmd)
output = True
else :
output = 'set runit to true'
OUT = output
If there is enough need/interest for the node I can add it back to Rhythm as a ZeroTouch implementation.
1 Like