代码拉取完成,页面将自动刷新
namespace TestShared;
public class TestText
{
[CommandMethod(nameof(TestDBText))]
public void TestDBText()
{
using var tr = new DBTrans();
tr.CurrentSpace.AddEntity(DBTextEx.CreateDBText(new(-1, -1, 0), "123", 2.5, action:t=> t.ColorIndex = 1));
tr.CurrentSpace.AddEntity(DBTextEx.CreateDBText(new(-1, -1, 0), "123", 2.5, action: t => {
t.Justify = AttachmentPoint.BaseCenter;
t.AlignmentPoint = new(1, 1, 0);
t.ColorIndex = 2;
}));
}
[CommandMethod(nameof(TestBackDBText))]
public void TestBackDBText()
{
using var tr = new DBTrans(@"C:\Users\vic\Desktop\test.dwg");
tr.CurrentSpace.AddEntity(DBTextEx.CreateDBText(new(-1, -1, 0), "123", 2.5, action: t => t.ColorIndex = 1));
tr.CurrentSpace.AddEntity(DBTextEx.CreateDBText(new(-1, -1, 0), "123", 2.5, action: t =>
{
t.Justify = AttachmentPoint.BaseCenter;
t.AlignmentPoint = new(1, 1, 0);
t.ColorIndex = 2;
}));
tr.Database.SaveDwgFile();
}
[CommandMethod(nameof(TestMText))]
public void TestMText()
{
using var tr = new DBTrans();
tr.CurrentSpace.AddEntity(MTextEx.CreateMText(new(5, 5, 0), "123", 2.5, action: t => t.ColorIndex = 1));
tr.CurrentSpace.AddEntity(MTextEx.CreateMText(new(5, 5, 0), "123", 2.5, action: t => {
t.Attachment = AttachmentPoint.TopCenter;
t.ColorIndex = 2;
}));
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。