CATDXImportExportFile CATDieImportExportServices

Usage: you must use this class as is. You should never derive it.


public class CATDieImportExportServices

Singleton Class for Import and Export services for V6.

Role: Singleton service class to import or export external files to/from V6

This is a SINGLETON class:
- Get a pointer to a static instance of this class with static method;
- Then use the returned pointer to the instance to Import ( ) and/or Export ( );
- After use, release the instance with static method.

DO NOT use "new", "delete" or "Release" on a pointer !

If the Import ( ) or the Export ( ) methods fail, you can get the error with method.
After use of the returned pointer, if it is no needed any more, it must be released.

See also:

CAASystemDoc.edu/CAASysTechArticles.doc/src/CAASysErrors.htm

Example:
   
HRESULT hr = S_OK ;

CATDieImportExportServices * pServicesInstance = CATDieImportExportServices::GetInstance();
if (NULL != pServicesInstance)
{
hr = pServicesInstance->ImportExternalFileToPLMObject(...) ;
// or
hr = pServicesInstance->ExportPLMObjectToExternalFile(...) ;
}
CATDieImportExportServices::DeleteInstance();

if ( FAILED(hr) )
{
CATError * pErrorMessage = CATError::CATGetLastError(ReturnCode) ;
...
if (pErrorMessage)
{
pErrorMessage -> Release () ;
pErrorMessage = NULL ;
}
}


Method Index


o DeleteInstance()
To delete the instance of the CATDieImportExportServices class.
o ExportPLMObjectToExternalFile(CATBaseUnknown*,CATUnicodeString&,CATUnicodeString&,CATUnicodeString&)
To Export a V6 PLM Object to an external file on disk.
o GetInstance()
To Get or Create an instance of the CATDieImportExportServices class.
o ImportExternalFileToPLMObject(CATUnicodeString&,CATUnicodeString&,CATBaseUnknown*&)
To Import an external file on disk into V6.

Methods


o DeleteInstance
public static DeleteInstance()
To delete the instance of the CATDieImportExportServices class.
Role: When you do not have to use the services any more, you must release the static instance of this class with this static method.
Example:
   CATDieImportExportServices::DeleteInstance();
o ExportPLMObjectToExternalFile
public ExportPLMObjectToExternalFile( const iObjectToExport,
const iOutputFilePath,
const iOutputFileExtension,
const iUsage)
To Export a V6 PLM Object to an external file on disk.
Role: This method exports a PLM Object already opened in session to an external file on disk.
It makes the conversion with the specified usage and the user's settings.
This method must be called on the pointer instance of (get by static method).
Parameters:
iObjectToExport
[in] The pointer to the input PLM object to be exported, opened in session. Usage depends on the output file format.
iOutputFilePath
[in] The complete path of the output file, without its extension (e.g. “c:\mydir\FileName” or “/u/dir/MyFile”).
iOutputFileExtension
[in] The extension for the exported file (e.g. “igs” for an IGES file, "stp" for a STEP file...).
iUsage
[in] The usage for the given extension (e.g. "IGES3D" for *.igs files).
Returns:
S_OK if the export is OK:
"iOutputFilePath.iOutputFileExtension" is created.
E_FAIL if the export is KO: no exported file created – See the associated error:
    Error class and identifiers:
  • LicenseERR_1211 : The license needed for this conversion is missing.
  • PathERR_1011 : It is not possible to write the output file in the output directory.
  • ExtensionERR_1111 : The output file extension is incorrect (unknown format).
  • ExtensionERR_1121 : The output file extension is not compatible with the input data.
  • UsageERR_1161 : The usage is not compatible with the output file extension or the input data.
    To get the error in case of failure, use CATError::CATGetLastError() (see CAASystemDoc.edu) - Release the returned pointer.
See also:
o GetInstance
public static GetInstance()
To Get or Create an instance of the CATDieImportExportServices class.
Role: To use services, You must get a pointer to a static instance of , with this method.
The instance is unique and is created if it does not exist yet.
Returns:
This method returns the pointer to the current instance of . You have to release it with (see below).
Example:
   CATDieImportExportServices * pServicesInstance = CATDieImportExportServices::GetInstance();
   
if (NULL != pServicesInstance)
{
// ...
}
CATDieImportExportServices::
();
o ImportExternalFileToPLMObject
public ImportExternalFileToPLMObject( const iInputFilePath,
const iUsage,
oImportedObject)
To Import an external file on disk into V6.
Role: This method imports an external file from its path to a V6 PLM Object in session.
It makes the conversion with the specified usage and the user's settings.

Precondition:
Before importing an external file, the user must have defined a PLM environment.
This method must be called on the pointer instance of (get by static method).
Parameters:
iInputFilePath
[in] The input file path, including its name and its extension (e.g. “c:\mydir\myfile.igs” or “/u/dir/file.stp”...).
iUsage
[in] The usage for the given extension (e.g. "IGES3D" for *.igs files). Usage depends on the input file format.
oImportedObject
[out] The pointer to the resulting PLM object of the translation.
Returns:
S_OK if the import is OK: the resulting PLM object is loaded in session....
E_FAIL if the import is KO: no PLM object created – See the associated error:
    Error class and identifiers:
  • LicenseERR_1201 : The license needed for this conversion is missing.
  • PathERR_1001 : The input file cannot be opened from the given path.
  • ExtensionERR_1101 : The input file extension is incorrect (unknown format).
  • UsageERR_1151 : The usage is not compatible with the input file extension.
    To get the error in case of failure, use CATError::CATGetLastError() (see CAASystemDoc.edu) - Release the returned pointer.
See also:

This object is included in the file: CATDieImportExportServices.h
If needed, your Imakefile.mk should include the module: CATDXImportExportFileServices

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.