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 · 4 comments · Fixed by #459 or #469 · May be fixed by #470
Open

Diferences on the file created by AcadSharp #458

thaiguer opened this issue Sep 25, 2024 · 4 comments · Fixed by #459 or #469 · May be fixed by #470
Labels
bug Something isn't working

Comments

@thaiguer
Copy link
Contributor

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
Contributor Author

thaiguer commented Sep 27, 2024

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 target file:
image

Uploading samples.zip…

@DomCR DomCR reopened this Sep 27, 2024
@DomCR DomCR linked a pull request Oct 4, 2024 that will close this issue
@DomCR DomCR closed this as completed in #469 Oct 4, 2024
@DomCR DomCR reopened this Oct 4, 2024
@DomCR
Copy link
Owner

DomCR commented Oct 4, 2024

RULESURF still not fix.

@DomCR DomCR linked a pull request Oct 4, 2024 that will close this issue
@thaiguer
Copy link
Contributor Author

thaiguer commented Oct 4, 2024

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 target file: image

Uploading samples.zip…

The Hatches missing inside Block References problem is solved. 👏
Here is an image of a file copying the entities from the existing DWG to a new one:
image

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
2 participants