# Synopsis

PDX_MSGT safp_ParseFile(long option, int model, char *file_name, MDA_ENT_FUNC *func)

# Purpose

Read a STEP file into a model.

# Description

The specified STEP file is parsed into a model. The STEP file must conform to the correct version of STEP Part 21. The parser supports entity long and short names. The short names must be incorporated into the ddf file (usually through the exp2ddf compiler) in order to be recognized. If there are any short/long name collisions, the short name has a higher precedence and will be recognized. Recoverable errors (such as an incorrect field type) will generate warning/error messages. Non-recoverable errors (such as an invalid file type) will cause an error to be set on the error stack and an error number to be returned.

# Input

## option

### SAFP_OVRWRT_OPT

If model contains entities, go ahead and parse the file. The resultant model will contain the new entities added to the existing model. If this option is not passed and their are more than 2 entities in the model, then the parser will not read the file.

### SAFP_HEADER_ONLY

Parse the header section only. After parsing, the model will only contain the file description, file name, and file schema entities. Before parsing the entire file, the model must be freed and reallocated.

### SAFP_SAVE_HASH_TABLE

Copy the hash table created for cross referencing STEP physical file ids (pfid) with database pointers. This will enable an application to use the step_GetDbptr function. The table must be released by the application using the step_FreeHash function.

## model

Model to place the entities in. The model must already be allocated with mda_AllocateModel.

## file_name

Name of file to be parsed.

## func

Function to be called with each entity after it is parsed or NULL if no function should be called. See mda_ParseFile for more information.

# Return

SAFP error code, if not SAFP_NOERR, mpm_DumpStack can be called to print the specifics of the error.