目录
MText
using (MText mText = new MText())
{
// 标注显示的内容
mText.Contents = text;
// 标注文本显示的位置
mText.Location = textLocation;
// 标注文本的宽度
mText.Width = fontWidth;
}
Leader
using (Leader leader = new Leader())
{
// 引线箭头所指的位置
leader.AppendVertex(arrowPoint);
// 如果引线想要直角效果加入改点
leader.AppendVertex(new Point3d(arrowPoint.X, textLocation.Y, 0));
// 文字所在位置
leader.AppendVertex(textLocation);
// 是否显示箭头
leader.HasArrowHead = true;
// 设置引线与标注文本ID关联
leader.Annotation = mText.ObjectId;
// 设置文字与引线的垂直位置关系,0代表居中
leader.Dimtad = 0;
// 设置引线的文字偏移0.1
leader.Dimgap = 0.625;
// 设置引线箭头大小
leader.Dimasz = 2.5;
// 重新刷新引线
leader.EvaluateLeader();
}