vagran / dxf-viewer

DXF 2D viewer written in JavaScript
Mozilla Public License 2.0
290 stars 86 forks source link

set attrib #63

Closed dotoritos-kim closed 1 year ago

dotoritos-kim commented 1 year ago

image

Now, rather than finding a layer based on the last insert, we prepare and render the attributes for each insert element. If you follow the attrib's ownerHandle, insertEntity exists.

vagran commented 1 year ago

I do not actually understand the logic in your code. If you just need to lookup insert entity by its handle, why just do not use a map with the handle as a key? What is the example file, and is there a visible problem in it, which is fixed by this PR?

dotoritos-kim commented 1 year ago

I do not actually understand the logic in your code. If you just need to lookup insert entity by its handle, why just do not use a map with the handle as a key? What is the example file, and is there a visible problem in it, which is fixed by this PR?

This is the AEC.dxf file I gave you before. There were attribs where some layers and colors were not applied. And the reason I wrote it like that is because I didn't think about how to use the hash table while writing this logic. We will improve later.