freejustin 发表于 2005-9-22 16:46:00

[ARX] 自定义实体拖动,在反应器重载函数中出错。

<P>数据库反应器函数重载函数</P>
<P>void CDbReactor::objectModified(const AcDbDatabase *dwg, const AcDbObject *dbObj)<BR>{&nbsp;</P>
<P>&nbsp;&nbsp;if ( Adesk::kTrue == dbObj-&gt;isKindOf(cascoCDeviceDrawing::desc()) )<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;<FONT color=#00ff00>cascoCDeviceDrawing</FONT> *pCEntity = cascoCDeviceDrawing::cast(dbObj<FONT color=#00ff00>);//自定义实体类</FONT><BR>&nbsp;&nbsp;&nbsp;if ( pCEntity ) <BR>&nbsp;&nbsp;&nbsp;{&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;AcDbObjectId t_pObjectId;<BR>&nbsp;&nbsp;&nbsp;&nbsp;t_pObjectId = pCEntity-&gt;objectId();<BR>&nbsp;&nbsp;&nbsp;<FONT color=#ff0000>&nbsp;*g_pObjectId = t_pObjectId;</FONT></P>
<P><FONT color=#0000ff>&nbsp;&nbsp;&nbsp;&nbsp;long lObjectId;<BR>&nbsp;&nbsp;&nbsp;&nbsp;lObjectId = t_pObjectId.asOldId();<BR>&nbsp;&nbsp;&nbsp;&nbsp;//ObjectID_Update( lObjectId );</FONT><BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}&nbsp;</P>
<P>}</P>
<P>为什么我在其它地方一旦用到红色的变量所指的全局变量或者蓝色的写到数据库中,其它地方读取该值。当拖动前面插入的自定义实体就会出错?</P>
页: [1]
查看完整版本: [ARX] 自定义实体拖动,在反应器重载函数中出错。