OUTPUT WINDOW

55 views
Skip to first unread message

mikael.s...@gmail.com

unread,
Mar 3, 2019, 8:37:10 AM3/3/19
to RevitPythonShell
I have an addin up and running and is great.

For cleanliness purposes I would like to hide the output window.

I have __window__.Visible = False at the beginning of the script and it works fine but as I press the button in the ribbon it still flashes for a second.

Is there a way to prevent this without having to convert my code to c# instead?

Thanks!

Mikael

Daren Thomas

unread,
Mar 4, 2019, 6:37:36 AM3/4/19
to revitpyt...@googlegroups.com
Dear Mikael, not as far as I know. But I have thought about that in the past and I think the way to go would be to have that as an option to the script configuration - a checkbox in the interface and an attribute in the XML definition of the scripts configured with RPS.

Question: Would you like to have a go at implementing that feature?

Daren

--
You received this message because you are subscribed to the Google Groups "RevitPythonShell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to revitpythonshe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mikael.s...@gmail.com

unread,
Mar 4, 2019, 6:44:55 AM3/4/19
to RevitPythonShell
Hi Daren!

Thanks for replying!
I'll definitely want to give it a go. Would make the experience very seamless.

How do I proceed to implement this feature?

Best

Mikael

Daren Thomas

unread,
Mar 4, 2019, 9:06:05 AM3/4/19
to revitpyt...@googlegroups.com
Mikael, I just looked through the source (it has been a while since I have actively worked on this) but it seems what you'll need to do is

- update RevitPythonShell.RevitPythonShellApplication.GetCommands() to return a new version of Command that has a new member "HideOutputWindow" (default: False) and read that from the settings file
- update the ConfigureCommandsForm to add a Checkbox for setting this member
- update RevitPythonShell.RevitPythonShellApplication.WriteSettings() to save the HideOutputWindow attribute (we could call it "hide-output-window" in the xml file maybe?)
- update RevitPythonShell.CommandLoaderBase: the constructor should take a new boolean "hideOutputWindow" (save to "_hideOutputWindow")
  - the Execute() method should check this variable and if it's true, use a silent subclass of ScriptExecutor (also to be created) OR have ScriptExecutor take this as a parameter and use a silent version of (ScriptOutputStream) - e.g. a file in the TEMP folder.
- update RevitPythonShell.RevitPythonShellApplication.CreateCommandLoaderAssembly() to create types using the new constructor instead of the one with just a string
- ... and then check the RpsAddin parts to see what needs to change there. it's a bit involved, but if you'd like to have a go, I'd love to add you to the contributors list!

Best,
Daren

Reply all
Reply to author
Forward
0 new messages