cart: empty [ Login ]

cloneContext changes Leader Landing distance

1 
Ken
4/12/2019 5:37 PM
I am running some code to clone a DWG. I have noticed the cloned copy have values that have changed from the original The original DWG has Leaders with a Landing Distance of 778.2 the cloned copy has Leaders with Landing Distance of 0.36 Below is an excerpt of the code showing the issue. I have attached a Leader.dwg files for testing
C# Code:
DxfModel model = DwgReader.Read(@"C:\Temp\Leaders.dwg"); DxfModel CleanModel = new DxfModel(); CleanModel.Header.LineTypeScale = model.Header.LineTypeScale; CloneContext cloneContext = new CloneContext(model, CleanModel, ReferenceResolutionType.CloneMissing); cloneContext.RenameClashingBlocks = true; foreach (DxfEntity entity in model.Entities) { DxfEntity clonedEntity = (DxfEntity)entity.Clone(cloneContext); CleanModel.Entities.Add(clonedEntity); } cloneContext.ResolveReferences(); DwgWriter.Write(@"C:\Temp\OUTPUT.dwg", CleanModel)
Wout
4/18/2019 3:36 PM
Hi, The problem has been fixed, thank you for the excellent bug report and test data. I've uploaded a new CadLib version. - Wout
1