Rhythm: PostableCommand.CloseHiddenWindows gone?

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,

  1. It’s a .DYF custom node. I am working on removing these from the package completely and being 100% ZeroTouch C# nodes.

  2. The method changed in the Revit 2019 API from PostableCommand.CloseHiddenWindows to PostableCommand.CloseInactiveViews. So rather than rebuild the logic, I dropped it. :grimacing:

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