几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】请问用arx中用什么来删除一个实体对象 ?在线等待 (http://www.dimcax.com/hust/showthread.php?t=8234)

yang686526 2009-04-18 09:52 PM

【转帖】请问用arx中用什么来删除一个实体对象 ?在线等待
 
请问用arx中用什么来删除一个实体对象 ?在线等待
请问用arx中用什么来删除一个实体对象 ?在线等待
目前已有该实体的acdbobjectid,用什么方法把它从当前数据库中删除?
reply
1.
inline acad::errorstatus
acdbopenobject(
acdbobject *& pobj,
acdbobjectid id,
acdb::openmode 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


所有的时间均为北京时间。 现在的时间是 09:56 AM.