vagran / dxf-viewer

DXF 2D viewer written in JavaScript
Mozilla Public License 2.0
295 stars 87 forks source link

ATTDEF problem #48

Open fiorefrank opened 1 year ago

fiorefrank commented 1 year ago

I have a dxf with some ATTDEF object and the vewer doesn't load dxf at alll. In the console there is "Unhandled entity type: ATTDEF".

how can i fix it?

dotoritos-kim commented 1 year ago

46 Currently, that feature is not complete. Please give your opinion in this pull request.

vagran commented 1 year ago

@fiorefrank Actually particular unhandled entity should not prevent your DXF from being loaded. What is the full console dump? Is it possible to get your example file for investigation?

terroj commented 1 year ago

I've the same problem

There is my file: https://drive.google.com/file/d/1g2zzLa31_fXrN94NmBVGIYy-NJUqNff_/view?usp=sharing

console log:

DxfScene.js:332 Unhandled entity type: ATTDEF
DxfScene.js:332 Unhandled entity type: ATTDEF
DxfScene.js:332 Unhandled entity type: ATTDEF
DxfScene.js:332 Unhandled entity type: ATTDEF
DxfScene.js:332 Unhandled entity type: ATTDEF
DxfScene.js:332 Unhandled entity type: ATTDEF
DxfScene.js:332 Unhandled entity type: ATTDEF
DxfScene.js:332 Unhandled entity type: ATTDEF
DxfScene.js:332 Unhandled entity type: ATTDEF
DxfScene.js:332 Unhandled entity type: ATTDEF
DxfScene.js:332 Unhandled entity type: ATTDEF

DxfScene.js:1414 Unresolved nested block reference: *U
_ProcessInsert @ DxfScene.js:1414
_ProcessDxfEntity @ DxfScene.js:308
Build @ DxfScene.js:175
await in Build (async)
_Load @ DxfWorker.js:159
await in _Load (async)
_ProcessRequestMessage @ DxfWorker.js:80
_ProcessRequest @ DxfWorker.js:64

DxfWorker.js:66 TypeError: Cannot read properties of undefined (reading 'RegisterNestedUse')
    at nm.NestedBlockContext (DxfScene.js:2454:15)
    at $f._ProcessInsert (DxfScene.js:1416:40)
    at $f._ProcessDxfEntity (DxfScene.js:308:18)
    at $f.Build (DxfScene.js:175:26)
    at async um._Load (DxfWorker.js:160:9)
    at async um._ProcessRequestMessage (DxfWorker.js:80:27)
    at async um._ProcessRequest (DxfWorker.js:64:18)
_ProcessRequest @ DxfWorker.js:66
vagran commented 1 year ago

Download link does not work for me: image

terroj commented 1 year ago

Download link does not work for me: image

https://drive.google.com/file/d/1g2zzLa31_fXrN94NmBVGIYy-NJUqNff_/view?usp=sharing

vagran commented 1 year ago

https://drive.google.com/file/d/1g2zzLa31_fXrN94NmBVGIYy-NJUqNff_/view?usp=sharing

Received, thanks! Will take a look soon.

vagran commented 1 year ago

https://drive.google.com/file/d/1g2zzLa31_fXrN94NmBVGIYy-NJUqNff_/view?usp=sharing

Issues with your sample file are fixed and included in just released version 1.0.28. The problem was not related to this issue, it is about unresolved block references handling. Also the file contains SPLINE entity which is defined by fit points which is not yet implemented (mostly because of lack of sample files), will check it later. For now some spline in this file is just not displayed. BTW Autodesk online viewer also reports some problems with the file, and limits the functionality of the viewer when displaying it.