HOOPS Exchange Documentation

< Home

< Reference Manual

< File Formats

PROGRAMMING GUIDE

Contents

1.0 Introduction

2.0 Getting started

3.0 Product occurrence

4.0 Reading geometry

5.0 Entity attributes

6.0 Views and PMI

7.0 Advanced functions

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();

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

  2. 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);

  3. 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.