如何禁止删除AcDbObject?
<p>想在ObjectArx中控制禁止删除AcDbObject元素,但执行以下数据库反映器时已经被删除了,</p><p>想调用pObj->erase(false),又因为pObj是const类型,想从数据库中重新读取AcDbObject又读不到了,怎么办?</p><p>void<br/>AsdkDbReactor::objectErased(const AcDbDatabase* db,<br/> const AcDbObject* pObj, Adesk::Boolean pErased)<br/>{<br/></p> <font size="2"><p>AcDbObject *p = <font color="#0000ff" size="2">const_cast</font><font size="2"><AcDbObject*>(</font><font color="#0000ff" size="2">pObj</font><font size="2">);</font></p></font><font color="#0000ff" size="2">const_cast</font><font size="2"><AcDbObject*>(</font><font color="#0000ff" size="2">pObj</font><font size="2">);</font><p><font size="2">p->erase(false);</font></p><p><font size="2"></font></p><p><font size="2">不知道这个偷懒的办法可行?</font></p>
页:
[1]