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

Diferences on the file created by AcadSharp #458

Open
thaiguer opened this issue Sep 25, 2024 · 2 comments · Fixed by #459
Open

Diferences on the file created by AcadSharp #458

thaiguer opened this issue Sep 25, 2024 · 2 comments · Fixed by #459
Labels
bug Something isn't working

Comments

@thaiguer
Copy link
Sponsor

Hello,

I used the following code to copy entities from one file to a new one:

using ACadSharp;
using ACadSharp.IO;

Console.WriteLine("Hello, World!");

string sourceFile = @"C:\dev\tablet.dwg";
string targetFile = @"C:\dev\just a drawing222.dwg";

using (DwgReader reader = new DwgReader(sourceFile))
{
    CadDocument doc = reader.Read();
    CadDocument newDoc = new CadDocument();

    foreach (var entity in doc.Entities)
    {
        doc.Entities.Remove(entity);
        newDoc.Entities.Add(entity);
    }

    using (DwgWriter writer = new DwgWriter(targetFile, newDoc))
    {
        writer.Write();
    }
}

I attached the source and the target file. files.zip
The problem is that there are a few differences and some missing entities in the target file.

Problem 1: Hatches missing inside Block References

Source:
image

Target:
image

Problem 2: Different color on a ByLayer Entity

Source:
image

Target:
image

Problem 3: OLE 2 Entity missing

Source:
image

Target:
image

@thaiguer thaiguer added the bug Something isn't working label Sep 25, 2024
@DomCR
Copy link
Owner

DomCR commented Sep 26, 2024

Hi @thaiguer,

The first problem seems to be related to the Hatch entities, I guess that is something related to the patterns, I have to take a look.

The second problem I've found an error in the Layer clone method.

I'll open 2 branches to fix this issues.

Thanks for the report!

@DomCR DomCR linked a pull request Sep 26, 2024 that will close this issue
@thaiguer
Copy link
Sponsor Author

Hello,
The problem 2 seems to be fixed, thanks for the correction.
Although, the Problem 1: Hatches missing inside Block References, is still happening.

Take a look at a image from the source file:
image

And take a look at a image from the targe file:
image

Uploading samples.zip…

@DomCR DomCR reopened this Sep 27, 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