cad新学生 发表于 2008-3-17 09:40:00

[求助]arx的反应器问题

<p>请教各位高手:</p><p>ARX中的反应器是否跟VBA中的事件是一个功能,其中的那个函数与VB中的BeginCommand对应?是CommandWillStart么?如果是又该怎么用呢?它与ObjectErase()有什么区别呢?我的目的就是捕捉AutoCAD的命令,好进一步处理!</p><p>小妹刚学ARX不久,此问题已找了两天,帮助文件读了不是很懂!哪位高手指点指点!please...</p><p>先谢谢了!</p>

HuaiYu 发表于 2008-3-17 11:53:00

本帖最后由 作者 于 2008-3-17 12:16:50 编辑 <br /><br /> <p>还有MM搞CAD开发,少见~~</p><p class="signature">virtual void</p><p class="signature">commandWillStart(</p><p class="signatureInEnd">const char* cmdStr);</p><p><table class="argumentList"><tbody><tr valign="baseline"><td class="argumentName">cmdStr</td><td class="argumentDescription">Passed in string of the command being executed</td></tr></tbody></table></p><p>This callback function indicates that the command cmdStr is about to begin execution.</p><p>cmdStr may be up to 257 characters (including the string terminator).</p><p>这个反应器是指命令启动前调用的。是编辑环境里用的</p><p>和那个VBA是一样的</p><p>ObjectErase 是AcDataBase里用的</p><p></p><p><a href="javascript:toggleproc( proc0, proc0img, 'PROC0' );" style="TEXT-DECORATION: none;"><img id="proc0img" src="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/Images/ac.down.gif" border="0" alt=""/> AcEditorReactor Command-Related Functions</a>
                <table cellpadding="6"><tbody><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcEd/AcEditorReactor/commandCancelled.htm">commandCancelled</a>
                                                </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcEd/AcEditorReactor/commandEnded.htm">commandEnded</a>
                                                </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcEd/AcEditorReactor/commandFailed.htm">commandFailed</a>
                                                </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcEd/AcEditorReactor/commandWillStart.htm">commandWillStart</a>
                                                </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcEd/AcEditorReactor/unknownCommand.htm">unknownCommand</a>
                                                </td></tr></tbody></table></p>

cad新学生 发表于 2008-3-17 14:30:00

谢谢!

<p>呵呵!我也没办法!不过谢谢你,可是我还想问一下AcDataBase和AcEditorReactor有什么区别?如果我是要对用户删除直线命令作出反应,应该用哪一个?我还得将用户删除的直线同步删除SQL Serve2000 中的数据,请问是否是捕捉选择集中的数据?再次感谢了!</p><p></p>

HuaiYu 发表于 2008-3-17 14:58:00

<p>我想该用AcDbObjectReactor这个类的</p><p><a href="javascript:toggleproc( proc1, proc1img, 'PROC1' );" style="TEXT-DECORATION: none;"><img id="proc1img" src="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/Images/ac.down.gif" border="0" alt=""/> AcDbObjectReactor Notification Functions</a>
                <p><table cellpadding="6"><tbody><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/cancelled.htm">cancelled</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/copied.htm">copied</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/erased.htm">erased</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/goodbye.htm">goodbye</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/modified.htm">modified</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/modifiedXData.htm">modifiedXData</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/modifyUndone.htm">modifyUndone</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/objectClosed.htm">objectClosed</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/openedForModify.htm">openedForModify</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/reappended.htm">reappended</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/subObjModified.htm">subObjModified</a>
                                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/unappended.htm">unappended</a>
                                                        </td></tr></tbody></table></p><p>先添加reactor到line中</p><p>用 <span class="H1Overlay" title="AcDbObject::addReactor Function">AcDbObject::addReactor Function 即</p><p class="signature">void</p><p class="signature">addReactor(</p><p class="signatureInEnd">AcDbObjectReactor* newObj) const;</p><p><table class="argumentList"><tbody><tr valign="baseline"><td class="argumentName">newObj</td><td class="argumentDescription">Pointer to transient reactor object to add</td></tr></tbody></table></p><p>Adds the transient reactor pointed to by pNewObj to the AcDbObject object's reactor list.</p><p>Note To add a transient reactor to an object, the object need only be open AcDb::kForRead (but it also works if it's open AcDb::kForWrite).</p><p>然后再在 AcDbObjectReactor的erased中去调用就可以了</p></span></p><p><table cellpadding="6"><tbody><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/cancelled.htm">cancelled</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/copied.htm">copied</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/erased.htm">erased</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/goodbye.htm">goodbye</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/modified.htm">modified</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/modifiedXData.htm">modifiedXData</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/modifyUndone.htm">modifyUndone</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/objectClosed.htm">objectClosed</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/openedForModify.htm">openedForModify</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/reappended.htm">reappended</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/subObjModified.htm">subObjModified</a>
                                        </td></tr><tr><td>&nbsp;</td><td class="functionLinks"><a href="mk:@MSITStore:D:\Program%20Files\objectarx2002\docs\arxref.chm::/AcDb/AcDbObjectReactor/unappended.htm">unappended</a>
                                        </td></tr></tbody></table></p><p>先添加reactor到line中</p><p>用 AcDbObject::addReactor Function 即</p><p class="signature">void</p><p class="signature">addReactor(</p><p class="signatureInEnd">AcDbObjectReactor* newObj) const;</p><p><table class="argumentList"><tbody><tr valign="baseline"><td class="argumentName">newObj</td><td class="argumentDescription">Pointer to transient reactor object to add</td></tr></tbody></table></p><p>Adds the transient reactor pointed to by pNewObj to the AcDbObject object's reactor list.</p><p>Note To add a transient reactor to an object, the object need only be open AcDb::kForRead (but it also works if it's open AcDb::kForWrite).</p><p>然后再在 AcDbObjectReactor的erased中去调用就可以了</p>

cad新学生 发表于 2008-3-21 08:20:00

谢谢了!我试试!呵呵!
页: [1]
查看完整版本: [求助]arx的反应器问题