A3DAsmComputeFilePathsFromModelFile

A3DStatus A3DAsmComputeFilePathsFromModelFile(const A3DAsmModelFile *pA3DAsmModelFile, A3DUns32 *uNbPartFiles, A3DUTF8Char ***ppPartFilePaths, A3DUns32 *uNbAssemblyFiles, A3DUTF8Char ***ppAssemblyFilePaths, A3DUns32 *uNbMissingFiles, A3DUTF8Char ***ppMissingFilePaths)
A3DStatus A3DAsmComputeFilePathsFromModelFile(const A3DAsmModelFile* pA3DAsmModelFile, A3DUns32* uNbPartFiles, A3DUTF8Char*** ppPartFilePaths, A3DUns32* uNbAssemblyFiles, A3DUTF8Char*** ppAssemblyFilePaths, A3DUns32* uNbMissingFiles, A3DUTF8Char*** ppMissingFilePaths)

Retrieve file paths constituting a model file, recursively.

A3DAsmComputeFilePathsFromModelFile lists all file paths constituting the input model file: sub-assembly, part, and missing files:

  • All sub-assembly files are stored in ppAssemblyFilePaths,
  • All part files are stored in ppPartFilePaths, and
  • All missing files are stored in ppMissingFilePaths.

A file path may be referenced both as part or sub-assembly. When this is the case, it is put only into ppAssemblyFilePaths.

Traversal starts from pA3DAsmModelFile and follows all referenced external files, which means that A3DAsmComputeFilePathsFromModelFile will always reference at least one path, corresponding to pA3DAsmModelFile.

The missing paths collection (ppMissingFilePaths) references files that could not be loaded (incorrect path, permission error, …).

On success, the function allocates arrays of UTF_8 strings and writes them to the output parameters. The caller is reponsible for this memory.

To release all allocated memory objects, call this function again with pA3DAsmModelFile set to 0, passing the same output parameters.

A3DUTF8Char **ppPartFilePaths, **ppAssemblyFilePaths, **ppMissingFilePaths;
A3DUns32      uNbPartFiles,      uNbAssemblyFiles,      uNbMissingFiles;

A3DAsmComputeFilePathsFromModelFile(
    pA3DAsmModelFile,
    &uNbPartFiles,     &ppPartFilePaths,
    &uNbAssemblyFiles, &ppAssemblyFilePaths,
    &uNbMissingFiles,  &ppMissingFilePaths
);

// ...Paths Available...

// Release
A3DAsmComputeFilePathsFromModelFile(
    0,
    &uNbPartFiles,     &ppPartFilePaths,
    &uNbAssemblyFiles, &ppAssemblyFilePaths,
    &uNbMissingFiles,  &ppMissingFilePaths
);

Return Values

A3D_INVALID_ENTITY_NULL: if uNbPartFiles or ppPartFilePaths is null

A3D_SUCCESS: returned on success

5.0

Parameters

pA3DAsmModelFile: Input model file. Can be “tree only” A3DAsmModelFile.

uNbPartFiles: Location to the number of found part files. Cannot be null.

ppPartFilePaths: Location to the path of each part files. Cannot be null.

uNbAssemblyFiles: Location to the number of found sub-assembly files.

ppAssemblyFilePaths: Location to the path of each sub-assembly files.

uNbMissingFiles: Location to the number of found missing files.

ppMissingFilePaths: Location to the path of each missing files.

Returns

A3D_SUCCESS on success, or an error code on failure