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

Unsupported code pair of dxf is swallowed #200

Closed
margaritadubkova opened this issue Jul 5, 2023 · 2 comments
Closed

Unsupported code pair of dxf is swallowed #200

margaritadubkova opened this issue Jul 5, 2023 · 2 comments

Comments

@margaritadubkova
Copy link

Hallo

Unsupported code pair in a dxf file is swallowed. We cannot open the dxf in AutoCad, but ixMilia load file without errors.
Please throw an Exception if code is not supported.

Our proposal:

In DxfCodePair.ExpectedType.cs at the line 97 change to:

throw new DxfReadException($"Unsupported code {code} at line {lineNumber}", lineNumber ?? 0);
instead of "expected = typeof(string); // unsupported code, assume string so the value can be swallowed"

also add extra argument "lineNumber" to the method DxfCodePair.ExpectedType(int code, int? lineNumber = null)

and in DxfTextReader at the line 74 add extra argument _lineNumber
var expectedType = DxfCodePair.ExpectedType(code, _lineNumber);

Thank you in advance.

@brettfo
Copy link
Member

brettfo commented Jul 5, 2023

One of the goals for this project is to be able to open any DXF, even if it's not strictly supported by AutoCAD. In fact, issue #106 was for a DXF generated by a third-party app that output a type code that's not defined by the DXF spec.

I'm curious, though, what's the code that isn't defined that you're seeing? What ENTITY/OBJECT is it under?

@margaritadubkova
Copy link
Author

Thank you, we will search another solution.

@brettfo brettfo closed this as completed Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants