属性块相关 改比例,改属性值
double scale =2;//需要放大 or缩小的倍数BlockReference br = ent as BlockReference;
// 1、改属性块比例
Matrix3d sMtx = Matrix3d.Scaling(scale, br.Position);
br.TransformBy(sMtx);
//
// 2、该属性块值 foreach (ObjectId adId in br.AttributeCollection)
{
AttributeReference attRef = myTrans.GetObject(adId, OpenMode.ForWrite, false) as AttributeReference;
if (attRef.Tag == "tag")
{
attRef.TextString ="new value"
}
} 正好需要,参考一下
页:
[1]