MSCE C# annotation scale 标注比例尺缩放问题

我用代码画了一个特定样式的标注,如图 ,然后我将annotation scale比例尺调成1:2后,标注变成下图所示 引线上下文字没有对齐。请问要如何设置才能使得该标注在比例尺更改的情况下也保持对齐?

Parents Reply Children
  • 请参考如下英文帖子看是否可行?

    I was wondering if anyone knows of a way to extend the in-line leader of a note through (or in between) the two lines of text easily. Does this functionality exist within the dimension style? See image…
    By in MicroStation > MicroStation Forum
    4 replies



  • 亲测,此方法可行,谢谢付老师。上代码,供大家参考:

    DimensionStyle dimStyle = DimensionStyle.GetSettings(dgnFile);
                dimStyle.SetBooleanProp(true, DimStyleProp.MLNote_ShowLeader_BOOLINT);//显示引线
                dimStyle.SetIntegerProp(0, DimStyleProp.MLNote_HorAttachment_INTEGER);//文字在引线的方位
                dimStyle.SetIntegerProp(3, DimStyleProp.MLNote_Justification_INTEGER);//横向对齐方式
                //dimStyle.SetIntegerProp(3, DimStyleProp.MLNote_VerticalJustification_INTEGER);//竖向对齐方式
                dimStyle.SetIntegerProp(1, DimStyleProp.MLNote_TextRotation_INTEGER);//旋转方式
                dimStyle.SetDoubleProp(-0.02 * this.FontHeight, DimStyleProp.MLNote_LowerMargin_DOUBLE);//底边距
                dimStyle.SetDoubleProp(-range.XSize / uor * 0.6, DimStyleProp.MLNote_LeftMargin_DOUBLE);//左边距
                dimStyle.SetDoubleProp(range.XSize / uor * 1.2, DimStyleProp.MLNote_ElbowLength_DOUBLE);//引线长度