# Synopsis

PDX_MSGT gdx_ModelWriteAGPS(long option, int gdxModelId, char *agpsFileName)

# Purpose

Write out a GDX model as an AGPS neutral file

# Description

A GDX model is written out to a file in AGPS format.

This function converts GDX faces, independent GDX NURBS surfaces, independent GDX NURBS curves, and independent GDX polylines (including those that contain only one point).

If there are any errors, processing is terminated and this routines is exited.

The GDX model to be processed has to be preprocessed to meet the following criteria: o All surfaces must be NURBS surfaces. o Independent curves can be either NURBS curves or polylines. o The first loop in a face needs to be the outer loop. o An edge curve must point to a single NURBS curve.

In the AGPS file, the following points hold: o The AGPS file is written out in the long-names text format (as opposed to original text or binary format). o Independent one-point polylines are written out as points. o Parameter-space curves are calculated in this routine, and are written out as NURBS curves. o Knots are scaled so that they lie between 0.0 and 1.0 inclusive.

# Input

## option

### GDX_OVERWRITE

If file already exists, overwrite the file. Default is to return an error.

## gdxModelId

Identifier of GDX Model

## agpsFileName

Name of output AGPS file

# Return

GDX_NOERR or error