Question to Dimstyle

Hello All,

I can ceate a Dim style but how I fit the text not Auto I wand do it insite

this I have:

if (null != dimstyle)
                        dimstyle.ArrowLength = 18 * scale;
                        dimstyle.TextHeight = 18 * scale;
                        dimstyle.TextGap = 6.8 * scale;
                        dimstyle.ExtensionLineOffset = 0;
                        dimstyle.ExtensionLineExtension = scale;
                        dimstyle.LengthResolution = 0;
                        doc.DimStyles.Modify(dimstyle, dimstyle.Id,false);

                        //RhinoApp.WriteLine(string.Format("Dimstyle \"{0}\" added.", dimstyle_name));
                        doc.DimStyles.SetCurrent(dimstyle.Index, false);


Moved to Scripting category

Hi Robert,
I’m not sure I understand what you want to do. Could you clarify?

Hi Alain,

sorry my english is not the best, but in the Dim Properties under Mach is a button Fit text and I wand do with c# Fit Text Option Inside

Thanks Robert

Hi Robert,
No worries. I think what you’re looking for is the FitText property on DimensionStyle.

Hi Alain,
Yes but I can´t found you have maybe a sample?

Thanks Robert

It’s not documented but it’s a property on DimensionStyle

var ds = doc.DimStyles.Current;
ds.FitText = DimensionStyle.TextFit.TextRight;

I know it’s confusing that the property name is FitText and the enum is TextFit.