Git Product home page Git Product logo

Comments (6)

brettfo avatar brettfo commented on August 15, 2024

Thank you for the bug report!

I've fixed the issue in commit aea4edd and master has the changes.

In short, the issue is that all DXF polylines are supposed to have a terminating SEQEND element after all the vertices, but that particular constructor of DxfPolyline was erroneously passing through null.

If you're not in a position to build from the latest sources (e.g., if you're using the NuGet package) then you can work around the issue by explicitly setting the Seqend property, either through the constructor:

new DxfPolyline(verticies, new DxfSeqend());
//                         ^^^^^^^^^^^^^^^ this is the important part

or by setting the property directly:

var poly = new DxfPolyline(vertices);
poly.Seqend = new DxfSeqend(); // this is the important part

from dxf.

brookman avatar brookman commented on August 15, 2024

Thank you very much for the super quick response. Awesome support!

I have now generated a file with a "SEQEND" but still get TrueView to crash. Autocad gives the following error message:

Undefined group code 330 for object on line 1578.
Invalid or incomplete DXF input -- drawing discarded.

If I manually edit the file and remove all 330 group codes (330 plus the next line inside every VERTEX and the SEQEND section) the file opens fine.

Edit/Workaround: If I comment line 209 in DxfEntityGenerated.cs the resulting files can be opened. Not sure if this has some undesired side effects though...

from dxf.

brettfo avatar brettfo commented on August 15, 2024

Thanks for digging around.

I read through the spec more and the 330 code pair on an entity is only for an owner handle to a parent DICTIONARY object, not just any drawing item like I previously assumed so the workaround of commenting out line 209 in DxfEntityGenerated.cs should be fine so long as none of your entities are contained in a DICTIONARY, which they probably arent.

I'll keep working on a better solution and post back here when I have one.

from dxf.

brettfo avatar brettfo commented on August 15, 2024

I've just pushed some changes to a branch named parent-handles. When you get a chance can you give that a try?

from dxf.

brookman avatar brookman commented on August 15, 2024

Hello Brett
Everything works fine with the parent-handles branch. Thank you very much!

from dxf.

brettfo avatar brettfo commented on August 15, 2024

Glad it works! I've merged parent-handles back into master.

from dxf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.