功能1, attribute中"香樟"->"楠木".
思路如下,
1.得到ID,
2. AcDbObjectPointer<AcDbBlockReference> pBlock(objId, AcDb::kForRead);, open
3. pBlock->attributeIterator(), 遍历attribute
4. acedSSGet()得到所有的要改变的entity, 相同方法遍历attribute, 然后AcDbAttribute->setTextString() 设置“楠木”
上述代码在我本地测试通过,win7+objectARX2010
功能2, 动态块custom attribute,
有点麻烦,暂时没空做。 |