dbtext
Application.SetSystemVariable("TEXTSIZE", 100);
//DBText tempText = new DBText
//{
// TextString = text,
// Height = textHeight,
// Position = textPos,
// Layer = layerName,
// HorizontalMode = TextHorizontalMode.TextCenter,
// VerticalMode = TextVerticalMode.TextBottom,
// AlignmentPoint = textPos
//};
//tempText.SetDatabaseDefaults(db); //这两个缺一不可
//tempText.AdjustAlignment(db);
var tempText = Z.CreateDBText(textPos,
text, textHeight, AttachmentPoint.MiddleCenter);
扩展管理器 Fitten Code
更新globalusing
public static Point2d ToPoint2d(this Point3d point)
{
return new Point2d(point.X, point.Y);
}
public static Point3d ToPoint3d(this Point2d point)
{
return new Point3d(point.X, point.Y, 0.0);
}
public static double Distance2dTo(this Point3d pt1, Point3d pt2)
{
// 计算X坐标差值的平方
double deltaX = pt2.X - pt1.X;
double deltaX2 = deltaX * deltaX;
// 计算Y坐标差值的平方
double deltaY = pt2.Y - pt1.Y;
double deltaY2 = deltaY * deltaY;
// 平方和开根号得到距离
return Math.Sqrt(deltaX2 + deltaY2);
}
System.Windows.Forms.MessageBox.Show("注册码无效!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); //警告感叹号
public Form1()
{
InitializeComponent();
this.StartPosition = FormStartPosition.CenterScreen;//窗体居中显示
}
块
if (block.IsLayout || block.I