Synopsis

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

Purpose

Read an ASCII DXF, Binary DXF, or Binary DWG file into a model.

Description

The specified file is parsed into the specified model. The type of the file will be automatically determined. ASCII DXF files, binary DXF files and binary DWG files are supported. Other file types will cause an error.

Please note that some of the dxfi entity structures which were added or were changed for revision 13 DXF support may get defaulted when parsing a pre-rev 13 file (e.g. new rev 13 DIMSTYLE fields). This parser supports DWG versions nine through 2000.

To setup a callback function to show the percentage of the file that has been parsed in, call the function dnfp_PercentageParsed(). For more information see dnfp_PercentageParsed().

Input

option

DXFI_OVERWRT_OPT

If the model contains entities, delete them before parsing the file. (i.e. start with a clean model)

DXFI_ONLY_ACAD_XDATA

Ignore extended entity data from any application other than AutoCAD.

DXFI_EXPLODE_FRAGMENTS

Explode mtext fragments to only keep simple formatting characters (P, \S, %%D, %%C, %%P) and throw away everything else. This option is useful when converting text to polyline.

model

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

file_name

Name of the file to be parsed.

func

Function to be called with each entity after it is parsed, or NULL if no function should be called.

Return

DXFI error code