SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
SketchUpModelExporterInterface Struct Referenceabstract

A valid SketchUp "exporter" plugin must support the following interface. See the SDK samples for an example. More...

#include <SketchUpAPI/import_export/modelexporterplugin.h>

Public Member Functions

virtual std::string GetIdentifier () const =0
 Returns a unique ASCII (non-localized) identifier for the exporter. For example, all SketchUp supplied exporters use the following convention for the id name: com.sketchup.exporters.extension. This id is used to identify the current default exporter and saved between invocations of SketchUp. More...
 
virtual int GetFileExtensionCount () const =0
 The number of extensions supported by the exporter. Must be > 0. More...
 
virtual std::string GetFileExtension (int index) const =0
 Each extension, assumed to be ASCII and case independent with no leading dot. More...
 
virtual std::string GetDescription (int index) const =0
 Return a brief description of the exporter for the file drop down box which may be extension specific. For example you may return "AutoCAD DWG Files" corresponding to the dwg extension and "AutoCAD DXF Files" corresponding to the dxf extension. Each extension and description pair will be entered into the exporter drop down list as a separate entry. More...
 
virtual bool SupportsOptions () const
 Indicates whether the exporter supports an options dialog. More...
 
virtual void ShowOptionsDialog (bool model_has_selection)
 Displays a modal dialog which controls options supported by the exporter. Implementing this is required if SupportOptions is true. Options should be saved someplace which persists between this method and ConvertFromSkp as well as between sessions. More...
 
virtual bool ExportSelectionSetOnly ()
 Indicates whether the plugin supports exporting just the selection. More...
 
virtual bool SupportsProgress () const
 Indicates whether the plugin supports the progress callback. More...
 
virtual bool ConvertFromSkp (const std::string &input_skp, const std::string &output, SketchUpPluginProgressCallback *progress, void *reserved)=0
 Performs the conversion from a temporary skp file to the target output file using options set during the ShowOptionsDialog method. More...
 
virtual void ShowSummaryDialog ()
 Displays a modal dialog showing an optional summary of the export process. The default does nothing. Note that Ruby scripting often disables this dialog.
 

Detailed Description

A valid SketchUp "exporter" plugin must support the following interface. See the SDK samples for an example.

Member Function Documentation

virtual bool SketchUpModelExporterInterface::ConvertFromSkp ( const std::string &  input_skp,
const std::string &  output,
SketchUpPluginProgressCallback progress,
void *  reserved 
)
pure virtual

Performs the conversion from a temporary skp file to the target output file using options set during the ShowOptionsDialog method.

Parameters
[in]input_skpEither a saved version of the current model or the current selection (if ExportSelectionSetOnly returns true). The method should read this file and convert to the output file. The file name is specified in UTF-8 and may require conversion to a platform-dependent format (i.e. UTF-16) for proper support of international file names.
[in]outputThe requested output file in UTF-8.
[in]progressThe exporter should support this progress interface. See that for details. The method should be tolerant to a NULL progress callback.
[in]reservedReserved for internal use.
Returns
  • true on success
  • false on failure or cancellation
virtual bool SketchUpModelExporterInterface::ExportSelectionSetOnly ( )
inlinevirtual

Indicates whether the plugin supports exporting just the selection.

Returns
  • true if the exporter supports an option to just export the selection AND the user has set that to true. If true, SketchUp will save the selected portion of the model and pass that into the ConvertFromSkp method.
virtual std::string SketchUpModelExporterInterface::GetDescription ( int  index) const
pure virtual

Return a brief description of the exporter for the file drop down box which may be extension specific. For example you may return "AutoCAD DWG Files" corresponding to the dwg extension and "AutoCAD DXF Files" corresponding to the dxf extension. Each extension and description pair will be entered into the exporter drop down list as a separate entry.

Parameters
[in]indexThe index of the extension
Returns
  • The description retrieved
virtual std::string SketchUpModelExporterInterface::GetFileExtension ( int  index) const
pure virtual

Each extension, assumed to be ASCII and case independent with no leading dot.

Parameters
[in]indexThe index of the extension
Returns
  • The file extension retrieved
virtual int SketchUpModelExporterInterface::GetFileExtensionCount ( ) const
pure virtual

The number of extensions supported by the exporter. Must be > 0.

Returns
  • The number of file extensions supported by this plugin
virtual std::string SketchUpModelExporterInterface::GetIdentifier ( ) const
pure virtual

Returns a unique ASCII (non-localized) identifier for the exporter. For example, all SketchUp supplied exporters use the following convention for the id name: com.sketchup.exporters.extension. This id is used to identify the current default exporter and saved between invocations of SketchUp.

Returns
  • A unique string identifier for the plugin
virtual void SketchUpModelExporterInterface::ShowOptionsDialog ( bool  model_has_selection)
inlinevirtual

Displays a modal dialog which controls options supported by the exporter. Implementing this is required if SupportOptions is true. Options should be saved someplace which persists between this method and ConvertFromSkp as well as between sessions.

Parameters
[in]model_has_selectionIndicates if the model has a current selection set. May be used in concert with ExportSelectionSetOnly to allow the exporter to export just the selected portion of the model. For example, you may enable a check box which controls this and return the state of that check box from ExportSelectionSetOnly.
virtual bool SketchUpModelExporterInterface::SupportsOptions ( ) const
inlinevirtual

Indicates whether the exporter supports an options dialog.

Returns
  • true if the exporter supports an options dialog. If so, the "Options" button will be enabled when your exporter is chosen, and selecting that button will call the exporter's ShowOptionsDialog method.
virtual bool SketchUpModelExporterInterface::SupportsProgress ( ) const
inlinevirtual

Indicates whether the plugin supports the progress callback.

Returns
  • true if the exporter supports the progress callback. If true, the plugin should periodically update the status with messages and percent complete as well as check if the user pressed the cancel button. If false, SketchUp will provide limited feedback on the progress of the export step.

The documentation for this struct was generated from the following file: