2014-08-05 19:25:18|?次阅读|上传:huigezrx【已有?条评论】发表评论
关键词:C/C++, CAA, CATIA|来源:唯设编程网
在其中:
● 添加了CreateCommands和CreateToolbars两个方法的声明;
● 添加头文件包含语句:#include "CATCmdContainer.h";
2). NewAddin.cpp源文件
在“NewAddin.cpp”最终完成的代码如下:
// COPYRIGHT Dassault Systemes 2013 //=================================================================== // // NewAddin.cpp // Provide implementation to interface // CATIPrtWksAddin // //=================================================================== // // Usage notes: // //=================================================================== // Apr 2013 Creation: Code generated by the CAA wizard Administrator //=================================================================== #include "NewAddin.h" #include "CATCreateWorkshop.h" #include "CATCommandHeader.h" CATImplementClass(NewAddin, Implementation, CATBaseUnknown, CATnull ); //----------------------------------------------------------------------------- // NewAddin : constructor //----------------------------------------------------------------------------- NewAddin::NewAddin(): CATBaseUnknown() { } //----------------------------------------------------------------------------- // NewAddin : destructor //----------------------------------------------------------------------------- NewAddin::~NewAddin() { } // Link the implementation to its interface // --------------------------------------- //TIE or TIEchain definitions #include "TIE_CATIPrtWksAddin.h" TIE_CATIPrtWksAddin(NewAddin); //Methods implementation void NewAddin ::CreateCommands(){ //new CAADrwHeader("CenterLine","CAADrwCenterLine","VCICenterLineCmd",(void *)NULL); } CATCmdContainer *NewAddin::CreateToolbars(){ NewAccess(CATCmdContainer, pCAADrwTlb, MyCenterLine); NewAccess(CATCmdStarter, pCenterLineStr, CenterLineStr ); SetAccessCommand(pCenterLineStr, "CenterLine" ); SetAccessChild(pCAADrwTlb, pCenterLineStr ); AddToolbarView(pCAADrwTlb, 1, UnDock); return pCAADrwTlb; }