Is there a python script that closes any open floating windows a script uses like the expression editor for example.
Thanks,
Max
Closing floating Windows after a running a script-Python
- Hirazi Blue
- Administrator
- Posts: 5107
- Joined: 04 Jun 2009, 12:15
Re: Closing floating Windows after a running a script-Python
Don't know of any "ready-made" script, but this should be fairly easy to implement utilizing the view object and setting the view.state, especially if you already know which views your script has opened.
;)
;)
Stay safe, sane & healthy!
Re: Closing floating Windows after a running a script-Python
Thanks Hizari,
That link helped and I have been informed by Andrew Hazelden http://www.andrewhazelden.com this may be the best way to do it
# Stop the PPG Windows from opening
Application.SetValue("preferences.Interaction.autoinspect", False, "")
That link helped and I have been informed by Andrew Hazelden http://www.andrewhazelden.com this may be the best way to do it
# Stop the PPG Windows from opening
Application.SetValue("preferences.Interaction.autoinspect", False, "")
-
- Posts: 12
- Joined: 04 Mar 2014, 14:40
- Location: West Dover, Nova Scotia, Canada
- Contact:
Re: Closing floating Windows after a running a script-Python
Hi Max.
Here is a python script example that will close a specific window:
Here is a python script example that will close a specific window:
Code: Select all
# Python Script - Close the Expression Editor window
def closeExprWindow():
# Window States
siNormal = 0
siClosed = 1
siMinimized = 2
# Target Window Name
targetWindowName = "Expression Editor"
# Get the active window list
layout = Application.Desktop.ActiveLayout
views = layout.Views
for x in views:
if str(x) == targetWindowName:
# Change the current window state to siClosed (1)
x.State = siClosed
print("The "+str(x)+" window has been closed")
# Close the Expression Editor window
closeExprWindow()
- csaez
- Posts: 253
- Joined: 09 Jul 2012, 15:31
- Skype: csaezmargotta
- Location: Sydney, Australia
- Contact:
Re: Closing floating Windows after a running a script-Python
There is a third argument on AddExpr() command to prevent the Expression Editor from appearing automatically (or use the OM)
http://download.autodesk.com/global/doc ... dExpr.html
http://download.autodesk.com/global/doc ... dExpr.html
Who is online
Users browsing this forum: No registered users and 22 guests