The function gOpenDXFFile() is used to initiate the process of obtaining DXF entity data using the function gGetNextDXFEntity(). Prior to calling this routine a file pointer of the required DXF metafile should be obtained using the routine gFopen() and passed in fp or unit.
The argument layer may be used to select a single layer from which entities are to be read, or if a blank or NULL string is passed, then all layers will be interpreted. Layer names may be obtained using the routine gEnqDXFLayers(). Thus the same layer name is used throughout the process of reading the entity data. If a different layer's data is required, the first process must be completed (see below) and this routine should be called again to initiate the process again.
Once the end of file marker has been read, or the process terminated for any other reason, the routine gCloseDXFFile() should be called to finalise the process of reading the entity data.