Model Configuration Import

When importing models in the c3d format, as well as models available through the SolidWorks, NX, Creo, Inventor, and Solid Edge plugins, it is possible to read the model in different configurations (variants). Configuration import from Catia is not implemented, because configurations in Catia are stored in a parametric form that C3D Converter does not support.

There are two ways to specify a configuration selector:

  • Pass a pointer to IConfigurationSelector to the LoadForeignReader() method when loading a plugin for subsequent use in import methods that explicitly specify the plugin.

  • Use the IConverter3D::SetConfigurationSelector() method for subsequent use in import methods that work through an automatically loaded plugin.

To work with these methods, it is necessary to implement the IConfigurationSelector interface (conv_requestor.h).

IConfigurationSelector interface methods:

// Add a configuration for selection by the user.
virtual void AddConfiguration( const c3d::string_t & configurationName ) = 0;

// Add a configuration without a model for selection by the user.
virtual void AddEmptyConfiguration( const c3d::string_t & configurationName )
{
    AddConfiguration( configurationName );
}

// Add a configuration that needs to be updated for selection by the user.
virtual void AddNeedsUpdateConfiguration( const c3d::string_t & configurationName )
{
    AddConfiguration( configurationName );
}

// Specify the index of the active configuration.
virtual void SetActiveConfiguration( const size_t index ) = 0;

// Get the index of the configuration selected by the user.
virtual size_t GetConfiguration() const = 0;

// Index of the configuration that should be returned to cancel reading on user request.
static const size_t configurationIdToCancel = SYS_MAX_T;
  • If GetConfiguration() is not explicitly used, the default configuration specified via SetActiveConfiguration() will be loaded.

  • The AddEmptyConfiguration() and AddNeedsUpdateConfiguration() methods are primarily informational, because unlike AddConfiguration() they do not allow obtaining a full model due to limitations of saving the model in the source CAD system.