C++, Rhino 6, Writing Plug-in Data to .3dm, Save Options

sdk
rhino6
filesave

(Luke Niwranski) #1

Hello,

In Rhino 5, CRhinoPlugIn::CallWriteDocument included a reference to file write options. The options allowed me to determine:

  • If only selected objects are being saved
  • If the file is being saved as a template
  • If only geometry is being saved
  • If user data should be saved

In Rhino 6, it looks like I can use CRhinoFileWriteOptions::TemplateFileIsDestination() to determine if the file is being saved as a template.

Is there a way to cover the other three cases (selected objects only, geometry only, user data)?

Thanks,

-Luke


(Dale Fugier) #2

Hi @lukeniwranski,

How about this?

BOOL CTest::CallWriteDocument(const CRhinoFileWriteOptions& options)
{
  // A template file is being saved
  bool bTemplate = options.TemplateFileIsDestination();

  // The selected object filter will be applied
  bool bSelected = options.SelectedObjectFilter();

  // The geometry only filter will be applied
  bool bGeometry = options.GeometryObjectFilter();

  // Plug-in information will be saved in the file
  bool bPlugIn = options.IncludePlugInInformation();

  return FALSE;
}

Note, if some of these options are set (by the user), your plug-in’s CRhinoPlugIn::CallWriteDocument may not be called.

– Dale


(Luke Niwranski) #3

Hi @dale,

Thanks, this should do the trick.

-Luke