[实体对象] 标注尺寸后面增加文字
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
var resSel =ed.GetSelection(new SelectionFilter(
new TypedValue[]
{
new TypedValue(0, "DIMENSION")
}));
if (resSel.Status != PromptStatus.OK)
return;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
foreach (ObjectId id in resSel.Value.GetObjectIds())
{
var dim = tr.GetObject(id, OpenMode.ForWrite) as Dimension;
dim.DimensionText = "<>(Str)";
}
tr.Commit();
}
页:
[1]