Closed xaotix closed 12 months ago
I adjusted the functions. Plesae let me know if this is the right way.
public static DxfDocument CloneAll(this DxfDocument document, DxfDocument destiny)
{
var entities = document.Layouts.GetReferences(netDxf.Objects.Layout.ModelSpaceName);
foreach (var obj in document.Entities.All)
{
var entity = obj as EntityObject;
var t1 = entity.Clone() as EntityObject;
destiny.Entities.Add(t1);
}
return destiny;
}
public static List<EntityObject> CloneAll(this DxfDocument document)
{
var list = new List<EntityObject>();
foreach (var obj in document.Entities.All)
{
var entity = obj as EntityObject;
var t1 = entity.Clone() as EntityObject;
list.Add(t1);
}
return list;
}
I have those extensions that I use to copy all objects from a Document to another. But, after upgrading from 2 to version 3, the function doesn't return the same old object.
Before was an 'EntityObject' now returns a 'DxfObjectReference'
How do I proceed to make this work again?