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

Dictionary name not stored when writing to DWG #397

Closed
Nubbit opened this issue Jul 27, 2024 · 1 comment · Fixed by #402
Closed

Dictionary name not stored when writing to DWG #397

Nubbit opened this issue Jul 27, 2024 · 1 comment · Fixed by #402
Labels
bug Something isn't working

Comments

@Nubbit
Copy link

Nubbit commented Jul 27, 2024

Describe the bug
The "Name" parameter of an extended dictionary/Xdictionary attached to an Entity(LwPolyline in my case) isn't stored when writing to a DwgFile when using DWG version AC1024, I also tried version AC1018 but also didn't seem to work.

To Reproduce

string FilePath = @"C:\Dev\Testfiles\sample.dwg";
CadDocument Document = new();
CadDocument NewDocument;
LwPolyline lwpoly = new();

lwpoly.CreateExtendedDictionary();
lwpoly.XDictionary.Name = "Test";
Document.Entities.Add(lwpoly);
Document.Header.Version = ACadVersion.AC1024;

using DwgWriter writ = new(FilePath, Document);
writ.Write();            

using (DwgReader reader = new DwgReader(FilePath))
NewDocument = reader.Read();

Expected behavior
The Xdictionary.name of the entity shouldn't be empty but 'Test'

Additional context
Even though the dictionary name is empty, the entries in the dictionary itself can be retrieved successfully from the generated DWG,

@Nubbit Nubbit added the bug Something isn't working label Jul 27, 2024
@DomCR
Copy link
Owner

DomCR commented Aug 3, 2024

Hi @Nubbit

This is actually the expected behavior for the XDictionary in any CadObject, the property Name is there for all NoneGraphicalObject to optimize the code, if a CadDictionary is stored as an entry of another dictionary, the entry will be the same as the name, that's why is there, but if the CadDicitonary belongs to a CadObject the name will not be relevant or stored at all.

I'll add a documentation note to make this clear in case that someone else have the same issue.

Thanks for the report!

@DomCR DomCR linked a pull request Aug 4, 2024 that will close this issue
@DomCR DomCR closed this as completed in #402 Aug 4, 2024
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