cart: empty [ Login ]

Dimension text style lost on Clone.

1 
Bogdan Eremia
1/30/2019 2:23 PM
Hello, When cloning a dimension the text style is reset to Standard - we need it to keep all the settings. Please see code below and resulting dwg. Can you please have a look and let me know if there is something we're doing wrong?
C# Code:
private static void CreatePrintLayout(DxfModel model, string layoutName) { bool allreadyThere = false; DxfLayout modelLay = model.ModelLayout; foreach (DxfLayout lay in model.Layouts) { if (lay.Name == layoutName) { allreadyThere = true; } } if (!allreadyThere) { DxfLayout layPrint = new DxfLayout(layoutName); model.Layouts.Add(layPrint); DxfModel targetModel = model; CloneContext cloneContext = new CloneContext(model, targetModel, ReferenceResolutionType.IgnoreMissing); layPrint.Entities.AddRange(modelLay.Entities.Clone(cloneContext)); } } CreatePrintLayout(model, "ESPrintPareLayout");
Wout
1/31/2019 2:55 PM
Can you try with cloneContext.ResolveReferences() after you do the cloning. You have to follow the example in the documentation. - Wout
Bogdan Eremia
1/31/2019 3:09 PM
Hello, That helped with the style style but i am still getting the text on the line instead of above the line as is in model - i assumed that the misalignment was because of the style. If i change the text style from AutoCAD to standard and then back to ISOCP2 it gets aligned correctly (above the line).
Wout
1/31/2019 3:13 PM
I'd need the input DWG file to reproduce the problem. - Wout
Bogdan Eremia
1/31/2019 3:20 PM
It's the same dwg i originally updated. But I'll attach the one resulting after the resolvreferences call.
Wout
1/31/2019 3:26 PM
I don't need the result, I need the input DWG file. - Wout
Bogdan Eremia
1/31/2019 3:26 PM
Also here is the one without the print layout - i think this is the one you we asking for?
Wout
1/31/2019 3:27 PM
Yup indeed, thanks. - Wout
Wout
1/31/2019 5:32 PM
Hi, Please download the latest CadLib verrsion from Your resources in your profile. The dimension block generation didn't take onto account the DxfDimensionStyle.TextVerticalPosition, and now it does. I don't think it's used very often, it seems to be used to create a vertical offset in case TextVerticalAlignment doesn't offer the desired position, so it's only used when TextVerticalAlignment is Centered. - Wout
Bogdan Eremia
1/31/2019 6:11 PM
That seems to have done it. Thanks for the help.
1