Skip to content

OLE Objects not cloned/copied #750

@thaiguer

Description

@thaiguer

Describe the bug or Feature Not Implemented Yet
The OLE objects are not cloned/copied from a given file to a new one.

To Reproduce

using ACadSharp;
using ACadSharp.Entities;
using ACadSharp.IO;
using ACadSharp.Objects;
using CSMath;

CloneAll(@"SourceSample.dwg", @"C:TargetSample.dwg");

void CloneAll(string sourceFilePath, string targetFilePath)
{
    CadDocument sourceFile;
    using (DwgReader reader = new DwgReader(sourceFilePath))
    {
        sourceFile = reader.Read();
    }

    var targetFile = new CadDocument();
    foreach(var entity in sourceFile.Entities)
    {
        targetFile.Entities.Add((Entity)entity.Clone());
    }

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

Expected behavior
All entities should be present on the new file.

Screenshots
Source File:
Image

Target File, Created by AcadSharp:
Image

Files
SampleFiles.zip

Release needed

  • Yes, using the Nuget package.
  • No, using the github repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions