nobody 发表于 2018-2-5 17:41:46

多线附加背景蒙版

这似乎没有为具有多行属性的块打开背景遮罩, 有人知道会是什么吗?BlockReference blkRef = (BlockReference)tr.GetObject(blkId, OpenMode.ForRead);。
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(blkRef.BlockTableRecord, OpenMode.ForRead);。
AttributeCollection attCol = blkRef.AttributeCollection;。
foreach (ObjectId attId in attCol)。
{。
AttributeReference attRef = (AttributeReference)tr.GetObject(attId, OpenMode.ForRead);。

if (attRef.IsMTextAttribute)。
{。
断续器UpgradeOpen();。
attRef.UpgradeOpen();       。
attRef.MTextAttribute.BackgroundFillColor = Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.None, 198);。
attRef.MTextAttribute.UseBackgroundColor = false;。
attRef.UpdateMTextAttribute();。
blkRef.RecordGraphicsModified(true);。

}。

}。

**** Hidden Message *****

nobody 发表于 2018-2-6 16:14:48

这里有解决方案
https://forums.autodesk.com/t5/net/background-mask-for-multiline-attribute-in-block/m-p/7756327#M57430
页: [1]
查看完整版本: 多线附加背景蒙版