- UID
- 112996
- 积分
- 215
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-3-13
- 最后登录
- 1970-1-1
|
发表于 2004-11-9 21:46:17
|
显示全部楼层
ref. below pls:
-----------------------------
AcTransaction::getObject Function virtual Acad::ErrorStatus
getObject(
AcDbObject*& obj,
AcDbObjectId objectId,
AcDb::OpenMode mode,
bool openErasedObject = false) = 0;
obj Returns pointer to obtained object
objectId Input objectId of object to obtain
mode Input mode to obtain in
openErasedObject Input Boolean indicating whether to obtain erased objects
This function is the transaction equivalent of acdbOpenObject. A pointer to the object identified by objectId is obtained under the transaction and returned in the obj argument. The mode argument specifies how the object is to be treated--as AcDb::kForRead, AcDb::kForWrite, or AcDb::kForNotify. If the openErasedObject Boolean is true, then even an erased object can be obtained. If openErasedObject is false, then trying to obtain an erased entity results in an error return value.
Returns Acad::eOk if successful. If openErasedObject is false, then trying to obtain an erased object results in a return status of Acad::eWasErased. If there are currently no transactions, then it returns Acad::eNoActiveTransactions.
Reminder Obtaining an object pointer via getObject() runs in parallel with acdbOpenObject(). This means that both can be in effect at the same time with AcDb::kForWrite status in both. For more information, see the section on transactions in the ObjectARX Developer's Guide.
[/COLOR]
Note This function is duplicated in the AcTransactionManager class where it always operates on the topmost AcTransaction object (by calling the getObject() function in the topmost transaction object). Only the topmost transaction is allowed to obtain entities, so using the AcTransactionManager version of this function is safer and easier. |
|