Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing Extended Entity Data stored in RawCodeValues back to DXF #9472

Open
cxcandid opened this issue Mar 16, 2024 · 3 comments
Open

Writing Extended Entity Data stored in RawCodeValues back to DXF #9472

cxcandid opened this issue Mar 16, 2024 · 3 comments

Comments

@cxcandid
Copy link

Feature description

When we use ogr2ogr to convert a DXF file to a format that natively supports StringList type for field RawCodeValues (i.e. GeoJSON) , we can export all AutoCAD Extended Entity Data (EED), if we set --config option DXF_INCLUDE_RAW_CODE_VALUES=TRUE. Unfortunately, the reverse does not work. We cannot write EED that is stored in RawCodeValues back to DXF.

I guess, it shouldn't be too difficult to write this data back.

Additional context

No response

@rouault
Copy link
Member

rouault commented Mar 16, 2024

CC @atlight

@atlight
Copy link
Contributor

atlight commented Mar 16, 2024

This would be reasonably straightforward to add. You would write a function to OGRDXFWriterLayer that is called from each of the Write* functions. The new function would validate the RawCodeValues list (ensure it has an even number of values and values at position 0, 2, ... are integers) and writes the entries out to the file line by line.

I'm unlikely to find time to develop this, but it should be straightforward enough for anyone with basic C++ knowledge. The only GDAL-specific thing is iterating through the StringList. I'd be glad to review a pull request.

@cxcandid
Copy link
Author

A small note on RawCodeValues validation. There is a mandatory application name (code 1001) that has to be registered in the AppID section of the DXF. Extended Entity Data is limited to 16K per entity. And there are multiple group codes for different data types (i.e. String, Int, Real). More info here: https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-A94BC605-5517-437F-A6FE-D3EB8116A01A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants