查看单个帖子
旧 2009-04-18, 09:52 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】请问用arx中用什么来删除一个实体对象 ?在线等待

请问用arx中用什么来删除一个实体对象 ?在线等待
请问用arx中用什么来删除一个实体对象 ?在线等待
目前已有该实体的acdbobjectid,用什么方法把它从当前数据库中删除?
reply
1.
inline acad::errorstatus
acdbopenobject(
acdbobject *& pobj,
acdbobjectid id,
acdb:penmode mode);
2.调用obj的erase方法
change your life style.
等于没说。
上面的都是已知的,关键是erase是在obj打开后就进行还是obj关闭后进行。还是自己试试看
reply
以下是引用zhang007在
以下是引用zhang007在
acdbopenobject(pobj,id,acdb::kforwrite);//pobj:acdbentity *
pobj->erase();
pobj->close();
erase() is a method of acdbobject, it doesn't really remove the object/entity from the database, it just set the erase bit to true, when drawing is going to be persisted, any objects with true erase bit will not be persisted.
so do as tigerhu do:
open the object/entity
call erase method
close the object/entity
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)