LibreDWG / libredwg

Official mirror of libredwg. With CI hooks and nightly releases. PR's ok
https://savannah.gnu.org/projects/libredwg/
GNU General Public License v3.0
969 stars 232 forks source link

dxf2dwg file does not open with minimal DXF #474

Open wanfahmi11 opened 2 years ago

wanfahmi11 commented 2 years ago

Hello everyone,

I’m using the dxf2dwg program and converting does prints some errors and warning:

ERROR: dwg_dynapi_entity_set_value: Invalid VPORT_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid LTYPE_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid LAYER_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid STYLE_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid VIEW_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid UCS_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid APPID_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid DIMSTYLE_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid BLOCK_CONTROL field objid Warning: Unknown HEADER.DIMSTYLE STANDARD dxf:3 Warning: Unknown HEADER.CMLSTYLE STANDARD dxf:2 Warning: Unknown HEADER.DIMSTYLE STANDARD dxf:3 Warning: Object handle not found, 1/1 in 41156 objects Warning: Object handle not found, 12/C in 41156 objects

The program successfully outputs to a DWG file. However, I got “Drawing file was created by an incompatible version” when opening it on Autodesk DWG Trueview 2022. Any clue? Thanks in advance

michal-josef-spacek commented 2 years ago

@wanfahmi11 Could be good insert example dxf file (something.dxf.gz/.zip).

wanfahmi11 commented 2 years ago

Here's the DXF file. Sorry for the delay. I missed this out. Thank you in advance and thank you for this amazing library!

my-drawing.dxf.zip

michal-josef-spacek commented 2 years ago

@wanfahmi11 Thanks. BTW: There is no DXF version in DXF file. What is generating this kind of DXF files?

wanfahmi11 commented 2 years ago

The DXF is generated through the Maker.js library https://maker.js.org/docs/exporting/#content. The DXF is very minimal though but still can be opened in Autodesk DWG TrueView.

michal-josef-spacek commented 2 years ago

@wanfahmi11 Thank you for the information.

rurban commented 2 years ago

The problem is that such a minimal DXF contains no handles, and we use the handles internally to find table entries. Thus we need to assign handles ourselves, at least on table controls and its entries.