2.3.1 Creating a model file entity and exporting it to a physical file

This section describes how to initiate the process of creating a model file and how to export that data to a physical file.

Create a file that contains the PRC data

1. Create a pointer that references a populated model file entity. (See Create a model file entity.) In the following example, createModelFile is a private function that returns a pointer to a populated model file.

A3DAsmModelFile* pModelFile = createModelFile();

2. Create the model file entity. (See Create a model file entity.)

3. Save the contents of the model file to a physical file by invoking the A3DAsmModelFileWriteToFile function.

if (p != NULL) {
if (_access(pcPRCName, 00) != -1)
_unlink(pcPRCName);
A3DInt32 iRet = A3DAsmModelFileWriteToFile(p, NULL, pcPRCName);

4. Delete the model file populated in Step 1.

NOTE: The Exchange API functions in this chapter are described as though implicit linking were possible. Wherever you see a direct call to one of these functions, you should instead use the pointer to the function. See Implementing external linking.