求助大佬!!
我用C#读取了一些参数属性并插入了对应的块,现在想修改这些参数值来实现自动生成图纸,但是参数修改后的块尺寸标注不会跟着变化(只有代码修改参数才有这个问题,手动修改是正常的。)怎么解决?
- using (Transaction trans = db.TransactionManager.StartTransaction())
- {
- BlockReference br = objectId.GetObject(OpenMode.ForWrite) as BlockReference;
-
- DynamicBlockReferencePropertyCollection propColl = br.DynamicBlockReferencePropertyCollection;
- foreach (DynamicBlockReferenceProperty prop in propColl)
- {
- if (prop.PropertyName.Equals("B"))
- {
- prop.Value = 800.0;
- }
- }
- br.DowngradeOpen();
- trans.Commit();
- }
|