Tabbed dockable panels in rhinopython

Hello forum,

Can anyone give me any code examples on how to use tabbed dockable panels using rhinopython?

I can make the forms themselves ok (i’m using WPF rather than windows forms), but I’m not sure how to get them into the panels. I have seen the links below, but having no C# background they are not much help.

Paul

https://github.com/mcneel/rhinocommon/tree/master/examples/PanelSamplePlugIn10
https://github.com/dalefugier/SampleCsPanel

That is going to not be currently possible using only python. The panels require a compiled plug-in.

@stevebaer, @DavidRutten

please excuse warming up this old thread. If a script gets compiled into a plugin using the RhinoScript compiler would it be technically possible to create a dockable panel from it if the script contains a WinForm ? In theory i would like to understand if the compiler could add similar information to the source files outlined here ?

thank you,
c.

‘Technically’ this is possible, but it would require some work on our end.

Thank you Steve, i would even add the required info to the source files manually (eg. from an example) to make it work. But i have no way to compile the source files once they where edited, using the RhinoScriptCompiler. :blush:

c.

I thought our compiler had an option to generate a project C# project (because that is what it is doing under the hood). Am I confused?

I don`t think you are. :slight_smile: If i create the source files i get them in my output (project) folder. But if i built the plugin, these files are not used. It uses a random named folder under this location instead:

C:\Users\Username\AppData\Local\Temp…

and cleanes files and folders once completed.

c.

What are the names of the files that get placed in your output folder if you create source files?

If i have one python script named “Bratwurst.py” and add this as a command to the RhinoScriptCompiler, then choose to generate the source files i get these:

AssemblyInfo.cs
Command_Bratwurst.cs
ScriptCode.recources

The files are placed in the project directory.

c.

Ok, I created a bug to implement the creation of a visual studio project file along with the other cs files.
http://mcneel.myjetbrains.com/youtrack/issue/RH-31536

Thank you @stevebaer.

I´m not shure what to do with them once this is hooked up, without VS. An example would be useful how to create a dockable dialog using only python. (title of this thread). I´m curious if this might be added to the RhinoScriptCompiler, so users working with python are able to create dockable dialogs. If this could be done by changing the project files or cs files manually and then use these files with the RhinoScriptCompiler to actually compile them to a plugin, this would be nice. I guess someone using VS already does not need the RhinoScriptCompiler or the project files at all.

c.

That is what is currently not possible because it would require some work on our end.

Yes please :wink:

Maybe one user friendly way from a scripters point of view would be an implementation of a scripting based dockable user panel which accepts WinForms (or ETO forms) in the future. So instead of choosing Rhino.RhinoApp.MainWindow() as the parent when showing a form like this:

form.ShowDialog(Rhino.RhinoApp.MainWindow())

It could be shown using such a dedicated UserPanel as the parent window of a form made in python. From the RhinoCommon helfile i´ve gathered that the registration and opening of the panel could technically be done via python. I´ve no idea how much work is involved to actually accomplish that without compilation but would accept any way to do it without using VS.

c.

Hi @stevebaer,

some 4.5 years after. Was anything done regarding this topic?

Thanks in advance.

(I’m sorry to bring the old topic but the title is very descriptive and there’s very good related info laid out above.)

No, all of the information on progress would be in the youtrack issue

1 Like

:sob:

Is there a way to push this up the priority list?

what does that mean?

It means I won’t fix the above listed youtrack issue. The issue isn’t necessary for implementing the feature requested in this thread.

How can one create dockable panel using IronPython? Is it implemented in another YT issue?

It isn’t possible, I’m rearranging issues at the moment and the one listed above turned out not to be the (in my opinion) best way to get to the ability to create dockable panels with python. I will create a new issue on this topic

https://mcneel.myjetbrains.com/youtrack/issue/RH-58023

2 Likes