A3DAsmModelFileLoadFromFile

A3DStatus A3DAsmModelFileLoadFromFile(const A3DUTF8Char *pcFileName, const A3DRWParamsLoadData *pLoadParametersData, A3DAsmModelFile **ppModelFile)
A3DStatus A3DAsmModelFileLoadFromFile(const A3DUTF8Char* pcFileName, const A3DRWParamsLoadData* pLoadParametersData, A3DAsmModelFile** ppModelFile)

Load an A3DAsmModelFile from a physical file, returning a handle to the new model file.

Successfully calling this function will always create a new model file, even if the call is made several times with the same input path. Once loaded, a handle to the new model file is stored in ppModelFile and you can query its content with A3DAsmModelFileGet.

A3DRWParamsLoadData parameters = A3D_MAKE_DATA(A3DRWParamsLoadData);
A3DAsmModelFile* model_file = A3D_NULL_HANDLE;

A3DStatus result = A3DAsmModelFileLoadFromFile(
    "/path/to/file.stl", &parameters, &model_file
);

assert(result == A3D_SUCCESS);
assert(model_file != 0);

Return Values

A3D_SUCCESS: in case of success.

A3D_INITIALIZE_NOT_CALLED: if pLoadParametersData is not initialized.

A3D_INVALID_DATA_STRUCT_NULL: if pLoadParametersData is 0.

A3D_INVALID_DATA_STRUCT_SIZE: if pLoadParametersData is not initialized by an incompatible version of the API.

A3D_INVALID_ENTITY_NULL: if ppModelFile is null.

A3D_LOAD_CANNOT_ACCESS_CADFILE: if the input path cannot be opened by the running process for reading.

A3D_LOAD_CANNOT_LOAD_MODEL: if an error occurred while reading the file.

A3D_LOAD_CANNOT_LOAD_MULTIENTRY: if load failed in the context of a multiple model input.

A3D_LOAD_EMPTY_MULTI_MODEL: if no product occurrence is found in the model file in the context of a multiple model input.

A3D_LOAD_FILE_PASSWORD_PROTECTED: if the reader can’t process because the file is protected by a password.

A3D_LOAD_FILE_TOO_OLD: if the reader support this format but the version is older than the minimum supported.

A3D_LOAD_FILE_TOO_RECENT: if the reader support this format but the version is more recent than the maximum supported.

A3D_LOAD_INVALID_FILE_FORMAT: if the format is not supported.

A3D_LOAD_MISSING_COMPONENTS: if the load partially completed.

A3D_LOAD_MULTI_MODELS_CADFILE: if the file contains multiple entries (see A3DRWParamsMultiEntriesData).

A3D_LOAD_READER_NOT_IMPLEMENTED: if the reader for the requested format is not available yet.

A3DAsmModelFileLoadFromFile A3DAsmModelFileLoadFromMultiplePrcFile A3DAsmModelFileLoadFromPRCFiles A3DAsmModelFileLoadFromXMLFile A3DAsmModelFileLoadFromXMLStream A3DPkPartsTranslateToA3DAsmModelFile A3DRWParamsGeneralData A3DRWParamsLoadData A3DRWParamsMultiEntriesData

Parameters

pcFileName: The system path to the input file. Must be a valid UTF-8 string.

pLoadParametersData: A set of options used to customize the behaviour of the loading.

ppModelFile: A pointer to the handle of the new model file, in case of success.

Returns

A3D_SUCCESS or an error code in case of failure.