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

DwgReader.Read not reading Polylines in Example file #471

Open
jhvjnr opened this issue Oct 11, 2024 · 4 comments
Open

DwgReader.Read not reading Polylines in Example file #471

jhvjnr opened this issue Oct 11, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@jhvjnr
Copy link

jhvjnr commented Oct 11, 2024

Describe the bug
When reading Example.dwg into a CadDocument, the CadDocument contains no entities, even though the file contained Polylines

image

To Reproduce

I run the following code:

doc = ACadSharp.IO.DwgReader.Read(memoryStream);

Providing Example.dwg as a MemoryStream

Example.zip

Expected behavior
Expected a successful read of the file like I see in other programs

Screenshots
The eventual output should look like this as seen in another cad program:

image

@jhvjnr jhvjnr added the bug Something isn't working label Oct 11, 2024
@DomCR
Copy link
Owner

DomCR commented Oct 12, 2024

Hi @jhvjnr,

The file that you send me doesn't have any polyline, all the entities seem to be proxy entities which are not stored in the file unless specified by the reader configuration.

Unfortunately ACadSharp is not capable of storing the geometric data yet, so you will only get the DxfClass of the proxy entity.

@jhvjnr
Copy link
Author

jhvjnr commented Oct 14, 2024

Hi @DomCR thank you for having a look at this and the feedback.

I think that at least some data must be stored in the file somehow as it is >6MB and I was sent the file as is, in isolation. Opening it in Autodesk TrueView shows this:

image

It looks like layers C-TOPO and HS2-00002BJS5-HFS-C01_Breaklines have polylines.

Maybe I have a misunderstanding? Should I be looking elsewhere than cadDocument.Entities?

Hopefully it is something simple like this!

Thanks,
jhvjnr

@DJGosnell
Copy link
Contributor

In addition to simple drawing entities, AutoCAD can contain many different types of much more complex entities known as Proxy Entities. Essentially they are a blob of data (like an image for example) that are to be read a certain way by the viewer and those methods have never been made public (as far as I know) for any the many proxy entities. If you find some documentation about how they are read (and written) that would be a path forward to be able to parse the data. Otherwise, reading this data would be an arduous task of trial and error by modifying the data in the CAD file and seeing how the output changes. This is also assuming the data in the proxy entity doesn't completely change every time, like in the case of certain encodings, compressions or encryptions.

@DomCR
Copy link
Owner

DomCR commented Oct 14, 2024

You can set the flag KeepUnknownEntities in the reader configuration to true so it keeps all these entities as unknown, but as @DJGosnell said, they will not contain any geometric data, only the DxfClass that identifies the proxy and the handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants