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

Support for multiple custom properties #22

Open
umstek opened this issue Sep 16, 2017 · 2 comments
Open

Support for multiple custom properties #22

umstek opened this issue Sep 16, 2017 · 2 comments

Comments

@umstek
Copy link

umstek commented Sep 16, 2017

A DXF file can contain multiple custom properties. Currently the parser thinks there's only one custom property and outputs "$CUSTOMPROPERTYTAG": "<Property Name>" and "$CUSTOMPROPERTY": "<Property Value>". The selected custom property happens to be the last one since the others are overridden by the last one. This structure should be something like:

"CUSTOMPROPERTIES": {
  "<Property Name>": "<Property Value>",
  "<Property Name>": "<Property Value>"
}

If this messes up the naming convention, $CUSTOMPROPERTIES can be used.

@bzuillsmith
Copy link
Member

Ah, I was unaware of this as there is nothing in the DXF reference. I see this has caught other libraries off guard as well. The format you specify seems like the way to go. I prefer not to have the $ prefix since it is not a direct reflection of the DXF reference. We should probably even just make the key "customProperties" to hold with the convention of other variables in dxf-parser that don't come directly from the DXF reference. This should produce an end result that can be used like the following:

dxf.header.customProperties["MyCustomProperty"]

@bzuillsmith
Copy link
Member

bzuillsmith commented Jan 9, 2018

@umstek Do you know of any reference for this?
I think what I need is a sample dxf header for testing.

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

2 participants