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

Document.Layouts returning no layouts #495

Closed
ITSJORDAN-TFA opened this issue Nov 22, 2024 · 5 comments · Fixed by #513
Closed

Document.Layouts returning no layouts #495

ITSJORDAN-TFA opened this issue Nov 22, 2024 · 5 comments · Fixed by #513
Labels
bug Something isn't working

Comments

@ITSJORDAN-TFA
Copy link

ITSJORDAN-TFA commented Nov 22, 2024

Describe the bug
When reading a DWG AC1014 created from DraftSight, it is returning document.Layouts.Count as 0, when it should be 2.

Additional context
Add any other context about the problem here.
If the issue is related to an specific dwg/dxf file and if able, attach that file to the issue of an equivalent with the same error.
I cannot attach the file due to data restrictions but could there be anything that happens in DraftSight that causes this DWG to be mismsatched? Other DWGs from draftsight work fine though

public bool HasReadableLayouts()
        {
            using (DwgReader reader = new DwgReader(filePath))
            {
                var document = reader.Read();
                if (document.Layouts.Count() == 0) return false;
                return true;
       }
}
@ITSJORDAN-TFA ITSJORDAN-TFA added the bug Something isn't working label Nov 22, 2024
@DomCR
Copy link
Owner

DomCR commented Nov 22, 2024

Hi @ITSJORDAN-TFA,

Older version like AC1014, have an object called VP_ENT_HDR_CTRL_OBJ, which stores the layout and viewport information. This object hasn't been implemented yet, I'll open a branch to fix it.

Thanks for the report!

@ITSJORDAN-TFA
Copy link
Author

Thanks @DomCR, I really love this library!

I will keep an eye out on the branch as I'm curious how you work on these sort of things, the file type is a black box for me

@DomCR
Copy link
Owner

DomCR commented Dec 19, 2024

I've started to take a look at this one, if you are curious about the dwg format check:

https://www.opendesign.com/files/guestdownloads/OpenDesign_Specification_for_.dwg_files.pdf

@DomCR DomCR linked a pull request Dec 19, 2024 that will close this issue
@ITSJORDAN-TFA
Copy link
Author

Appreciate you resolving this I'll rerun my document through, question too. How easy would it be for me to adapt this to be able to read the layout information of the older DWG formats too?

@DomCR
Copy link
Owner

DomCR commented Dec 21, 2024

I've tested older version of dwg, your case seems to be an exception.

If it doesn't work, could you provide a file as an example so I can test it?

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

Successfully merging a pull request may close this issue.

2 participants