Encounterred an exception: "The block record $MODEL_SPACE is not defined"

Mar 4, 2013 at 2:42 PM
I tried to use the reader to load a dxf file made by AutoCad. However, an exception was thrown:
"The block record $MODEL_SPACE is not defined". I have a pair:
$MODEL_SPACE
70
 0
10
0.0
20
0.0
30
0.0
3
$MODEL_SPACE
defined in the dxf file.
Any idea why this exception was thrown? Does the reader support model_space?

BTW, I have another dxf file that contains "*model_space" and that file can be successfully loaded by the reader.
Thanks!!!
Coordinator
Mar 4, 2013 at 6:04 PM
The Model_Space is a reserved block for AutoCAD, if you save a file as a dxf prior to AutoCAD2000 this Model_Space block will have the name $MODEL_SPACE (other programs might save it as *MODEL_SPACE), but for later version is saved as *Model_Space. Remember the library only supports dxf versions AutoCAD2000 and higher.

If you have saved as a supported dxf version, something might be wrong with that file. This exception is thrown when a BLOCK in the BLOCKS section does not find the matching BLOCK_RECORD in the TABLE section, and this is something that all dxf files must comply. Check if you can find under the TABLE section a BLOCK_RECORD with a name similar to it, the name is defined under a code 2 and 3 entry. The TABLE section is defined before the BLOCKS section.

Try to open that file in AutoCAD, if it is able to load it, purge the drawing for unwanted stuff and try to saved it again.

Daniel