[Rhinocommon] File Export Plugin Options

Wondering which is the appropriate* method for adding export options to an Export Plugin in rhinocommon? For example, I’d like the SaveFileDialog to show options in a similar manner to some of the other exporters:

When the user hits ‘save,’ the options page should appears with the custom exporter options. I can write a form that will prepare these options for me, but it seems there is some built in functionality to the PlugIn Class and OptionsDialogPages stands out as something I should override, but an example would be great.

*when I say appropriate, I mean an option that would be compatible across platforms

Seems it is connected to this issue: Custom properties window and on youtrack: http://mcneel.myjetbrains.com/youtrack/issue/RH-28555

I see some example code here: https://github.com/mcneel/rhinocommon/blob/master/examples/cs/OptionsControl.cs

which is called by this: https://github.com/mcneel/rhinocommon/blob/master/examples/cs/examples_csPlugIn.cs

It seems heavily dependent on System.Windows.Forms and other things that might not work well on other platforms. Perhaps I try the ETO route and just run a control when the user gets to the appropriate part of the code.

@tim can you help?

For the couple of I/O plugins that I’ve ported over from C++ to C# and RhinoCommon, having the test command that included the file extension in the name worked for me. Here’s an example from the PLY export plugin.

  [CommandStyle(Style.Hidden | Style.Transparent)]
  public class ExportPlyPlugInOptionsCommand : Rhino.Commands.Command
    public override string EnglishName
      get { return "PLYExportOptionsDialog"; }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
      return ExportPlyPlugIn.Instance.UI(true, true);

I hope this helps.


1 Like