CATIA二次开发之CAA+RADE+VS安装配置全过程
CATIACAA二次开发详细教程(10)文档操作方法创建加载保存

CATIACAA二次开发详细教程(10)文档操作方法创建加载保存CATIA CAA 二次开发详细教程(10)文档操作方法创建加载保存一、创建(Create the new document)CATDocument* pDoc = NULL;rc = CATDocumentServices::New("Part",pDoc);if (NULL != pDoc){cout << "New document created OK" << endl << flush;}else{cout << "ERROR in creating New document" << endl << flush;return 2;}Now that the session is opened, you can create a new document using the New static method of CATDocumentServices. This method creates a document and initializes it, allowing it to be loaded and stored and making it editable. In this use case, a pre-defined document type, "Part", is used as a document type. In interactive mode, this is the name that appears when performing a File/New operation. It is not the file extension, which, in this case, is "CATPart".二、打开(Load the document)CATDocument *pDoc = NULL;rc = CATDocumentServices::Open(argv[1],pDoc);if (SUCCEEDED(rc) && (NULL != pDoc)){cout << "Document opened OK" << endl << flush;}else{cout << "ERROR in opening an existing document" << endl << flush;return 2;}Now that the session is opened, you can load an existing document using the Open static method of CATDocumentServices. This method needs, as a first parameter, the entire storage path name and document name of the existing document that we want to load into the session. In this use case, we enter this information as an argument to the program. The second parameter of the Open method returns a CATDocument pointer to the document it has loaded.Once the document exists in the session, you can work with objects within it, using specific interfaces external to the ObjectModelerBase framework.三、获取当前文档CATFrmEditor * pEditor = GetEditor();if (NULL != pEditor ){cout << "Editor got OK" << endl << flush;}else{cout << "ERROR in getting the current editor" << endl << flush;}CATDocument *pDoc = pEditor->GetDocument();if (NULL != pDoc){cout << "Document opened OK" << endl << flush;}else{cout << "ERROR in opening an existing document" << endl << flush;return 2;}四、提取根容器(Retrieving the Document Root Container)CATInit *piInitOnDoc = NULL;rc = pDoc -> QueryInterface (IID_CATInit, (void**) &piInitOnDoc);if (FAILED(rc)){cout << "ERROR in QueryInterface on CATInit for doc" << endl << flush;return 3;}const CATIdent idCATIContainer = "CATIContainer";CATIContainer *piRootContainer = NULL;piRootContainer = (CATIContainer*) piInitOnDoc -> GetRootContainer(idCATIContainer);if (NULL == piRootContainer){cout << "ERROR in GetRootContainer" << endl << flush;}The document root container is retrieved using the CATInit::GetRootContainer method. The CATIContainer handle retrieved through GetRootContainer will be necessary whenever you want to create or manipulate objects in the document.五、保存文档(Save the Document)5.1 另存rc = CATDocumentServices::SaveAs (*pDoc, argv[1]);if (SUCCEEDED(rc)){cout << "Document saved OK" << endl << flush;}else{cout << "ERROR in saving document" << endl << flush;return 5;}To save the new document, use the SaveAs static method of CATDocumentServices. This method takes the pointer to the document created by New as a first parameter, and the storage path name and document name under which the document is to be stored as a second parameter. In this use case, we pass the storage path name and document name as an argument to the program.5.2 保存rc = CATDocumentServices::Save (*pDoc);if (SUCCEEDED(rc)){cout << "Document saved OK" << endl << flush;}else{cout << "ERROR in saving document" << endl << flush;return 3;}To save the new document under the same name, use the Save static method of CATDocumentServices. This method takes the CATDocument pointer to the document as the only parameter.六、删除(Remove the document)rc = CATDocumentServices::Remove (*pDoc);if (SUCCEEDED(rc)){cout << "Document removed OK" << endl << flush;}else{cout << "ERROR in removing document" << endl << flush;return 6;}If you ever needed to re-open the document during this same session, it would then be necessary to also remove it from the session after having saved it. Otherwise, you need not worry about it since deleting the session will automatically remove the document as well. To remove the document, you should use the Remove static method of CATDocumentServices.七、按指定文档格式保存(Exporting a Document Format Type)7.1 Defining the New Document Format TypeCATProduct_OmbExportType CATIExportTypeManagerlibCAAOmbExportTypeA new document format type is simply defined by adding a new entry in the current framework's dictionary. This new entry will cause the File/SaveAs dialog box to list the new format type among the types defined to the save operation. The first parameter, CATProduct_OmbExportType, indicates that the exporting document is a Product-type document (i.e., a document having a .CATProduct suffix) and that the exported document format type is "OmbExportType", which will also be the suffix of the saved document. The second parameter indicates that this new document type will implement the CATIExportTypeManager interface in order to define the specific save operations necessary to export the new document. The last parameter is the name of the library in which the implementation module is to be found.7.2 Implementing CATIExportTypeManager See the Object Modeler articles [2] for a detailed explanation about interface implementations.The implementation of CATIExportTypeManager is found in the CAAOmbExportType.m module defining the CAAEOmbExportTypeData implementation class.CATImplementClass( CAAEOmbEExportTypeData,CodeExtension,CATBaseUnknown,CATProduct_OmbExportType );The CATImplementClass macro defines the implementation class CAAEOmbExportTypeData as a code extension implementing theCATProduct_OmbExportType late type.#include "TIE_CATIExportTypeManager.h"TIE_CATIExportTypeManager( CAAEOmbExportTypeData );The above statement indicates that this is an implementation of the CATIExportTypeManager interface.HRESULTCAAEOmbExportTypeData::ExportData( CATDocument *pDoc,CATUnicodeStringpath ){cout << "************** Begin ExportData 1" <<endl << flush;HRESULT rc = CATDocumentServices::SaveAs(*pDoc,path);return rc;}In this case, the document is simply saved using the SaveAs method of CATDocumentServices. However, it is in this method that you must code any specific save operations necessary for your new document type.。
基于CAA 的CATIA 二次开发

上海大学2013 ~2014 学年秋季学期研究生课程考试(小论文)课程名称:计算机辅助设计制造课程编号:论文题目: 基于CAA 的CATIA 二次开发研究生姓名: 学号:论文评语:成绩: 任课教师:评阅日期:基于CAA 的CATIA 二次开(上海大学机电工程与自动化学院,上海200072)摘要:介绍CA TIA 二次开发的几种方式,并对CATIA 的主要开发平台CAA 进行了初步研究,阐述了CAA 的组成、架构、原理、功能和国内外的最近研究情况,提出了基于CAA 的CATIA 二次开发的基本方法,并提供了具体开发实例。
关键词:二次开发;CA TIA;CAA;面向对象程序设计;COMThe Secondary Development of CATIABased on CAA(School of Mechatronic Engineering and Automation, Shanghai University, Shanghai 200072, China)Abstract: This paper introduces several methods of the secondary development for CATIA. The structure and the functions of CAA are provided in the paper. The key methods and examples of the secondary development for CATIA are also presented.Key words: secondary development; CATIA; CAA; object-oriented-programming; COM1引言CA TIA(Computer Aided Tri-dimensional Interface Application)是法国Dassault Systemes 公司开发的CAD/CAM/CAE/PDM 一体化软件。
catiaV5 R22安装步骤

1.安装vs20082.安装CATIAV5R22_32bit_P3 or _64bit_可以修改一下安装目录:D:\ds\R22 第一个目录修改D:\ds\CatEnv第二个目录修改其他默认3.破解Catia(可以暂时不管和步骤7一起破解)1.严格按照【破解说明.pdf】安装2.对【破解说明.pdf】中5.1步骤说明:2.1.图左边【Licenses】为本目录下【Licenses(32)】或【Licenses(64)】2.2.右边【C:\ProgramData\DassaultSystemes】为隐藏文件夹,需要打开隐藏2.3破解成功后如下两图:4.VPM可以不安装(用于数据库连接貌似)5.安装CAA:直接NEXT安装即可V56R2012.CAA_CATIA_P3.windows.1-16.安装Rade环境变量目录修改为同CATIA:D:\ds\CatEnv7.破解Rade1.严格按照【破解说明.pdf】安装2. 对【破解说明.pdf】中3.8步骤说明2.1生成许可可以选择Rade和Catia,生成两个许可文件2.2添加许可再在license manager里面按照【破解说明 .pdf】4.1中添加上述两个许可:3.对破解步骤3.6-3.9的说明1.先导出CATIA破解文件,并完成后面CATIA的破解步骤,直到文档末尾2.再导出CAA RADE破解文件,并完成本文档【8配置RADE的操作】就可破解RADE4.对【DSLS_SSQ_Setup_eng.pdf】中5.1步骤说明:4.1.图左边【Licenses】4.2.右边【C:\ProgramData\DassaultSystemes】为隐藏文件夹,需要打开隐藏4.3破解成功后如下两图:8.配置Rade8.1许可 CATVBTLicenser.exe8.1.1报错8.2环境配置CATVBTSetup.exe9.常见问题:9.1.License Manager问题在导入license时报错解决:localhost必须保持连接状态9.2打开vs2008以后出现很多错误对话框解决:重复步骤7和步骤89.3 打开工程mkmk时报错:link error 2001 解决:安装vs2008 sp19.4 打开setting management 后没任何内容卸载后全部重装后解决9.5安装过程是否需要重启不需要重启。
CAA插件的开发方法(CATIA二次开发)

插件的开发方法2004-8-24一、创建插件接口1.1 头文件如:#ifndef CAAIAfrGeoCreationWkbAddin_h#define CAAIAfrGeoCreationWkbAddin_h// ApplicationFrame Framework#include <CA TIWorkbenchAddin.h>// Needed to derive from CATIWorkbenchAddin// Local Framework#include "CAAAfrGeoCreationWbench.h" // Needed to export the IID// Global Unique IDentifier defined in .cpp// exported by CAAAfrGeoCreationWbenchextern IID ExportedByCAAAfrGeoCreationWbench IID_CAAIAfrGeoCreationWkbAddin;class ExportedByCAAAfrGeoCreationWbench CAAIAfrGeoCreationWkbAddin : public CATIWorkbenchAddin {// Used in conjunction with CATImplementInterface in the .cpp fileCA TDeclareInterface;public:};#endif1.2 源文件1.2.1 组成1)接口标识符(IID)构造2)接口实现1.2.2 实例如:#include <CAAIAfrGeoCreationWkbAddin.h>// Use uuid_gen -C on UNIX or uuidgen -s on NT to generate the IIDIID IID_CAAIAfrGeoCreationWkbAddin = { /* a4188b88-d4c1-11d3-b7f5-0008c74fe8dd */0xa4188b88,0x11d3,{0xb7, 0xf5, 0x00, 0x08, 0xc7, 0x4f, 0xe8, 0xdd}};// Declares that CAAIAfrGeoCreationWkbAddin is an interface that// OM-derives from CATIWorkbenchAddinCATImplementInterface(CAAIAfrGeoCreationWkbAddin, CATIWorkbenchAddin);1.3 TIE文件1.3.1 内容头文件引用1.3.2 实例如:// Used by mkmk to create TIE_CAAIAfrGeoCreationWkbAddin.h#include <CAAIAfrGeoCreationWkbAddin.h>详见《接口开发》二、插件开发2.1 头文件2.1.1 结构#ifndef <插件类>_H#define <插件类>_H// System framework#include "CATBaseUnknown.h" // Needed to derive from CATBaseUnknown// ApplicationFrame framworkclass CATCmdContainer; // Needed by CreateToolbarsclass <插件类> : public CATBaseUnknown{// Used in conjunction with CATImplementClass in the .cpp fileCATDeclareClass;public:<插件类> (); //构造函数virtual ~<插件类> (); //析构函数// Instantiates the command headers for the commandsvoid CreateCommands(); //定义命令标签// Creates toolbars and arranges the commands insideCA TCmdContainer * CreateToolbars(); //创建菜单和工具条private:};#endif2.1.2 实例#ifndef CAAAfrGeoOperationAdn_H#define CAAAfrGeoOperationAdn_H// System framework#include "CA TBaseUnknown.h" // Needed to derive from CATBaseUnknown// ApplicationFrame framworkclass CATCmdContainer; // Needed by CreateToolbarsclass CAAAfrGeoOperationAdn : public CATBaseUnknown{// Used in conjunction with CATImplementClass in the .cpp fileCA TDeclareClass;public:CAAAfrGeoOperationAdn();virtual ~CAAAfrGeoOperationAdn();// Instantiates the command headers for the commandsvoid CreateCommands();// Creates toolbars and arranges the commands insideCA TCmdContainer * CreateToolbars();private:};#endif2.2 源文件2.2.1 定义命令标签类如:2.2.2 建立“联结(TIE)”对象指定插件插入的交互界面,如:1)界面#Include “TIE_CATIShapeDesignWorkshopAddin.h”;TIE_CATIShapeDesignWorkshopAddin(CAAEMmrCombinedCurveAdn);2)“零件设计(Part Design)”界面#include <TIE_CATIPrtWksAddin.h>TIE_CATIPrtWksAddin(CAAMmrDebugAdn);2.2.3 声明插件类CATImplementClass(CAAMmrDebugAdn, DataExtension, CATBaseUnknown,CAAMmrDebugAddin);2.2.4 更新接口字典文件2.2.4.1 字典文件名<框架>.dico2. 2.4.2 存放目录<>\CNext\Code\Dictionay2. 2.4.3 语句如插入如下结构的语句行:<接口实现类> <TIE接口类> <共享库名>如:CAAMmrCombinedCurveAddin CA TIShapeDesignWorkshopAddin libCAAMmrCombinedCurveAddIn其中:(1)<接口实现类>在CATImplementClass中指定,如CAAMmrCombinedCurveAddin:CATImplementClass ( CAAEMmrCombinedCurveAdn ,DataExtension ,CA TBaseUnknown ,CAAMmrCombinedCurveAddin );(2)<TIE接口类>TIE语句中所定义,如CATIShapeDesignWorkshopAddin:TIE_CATIShapeDesignWorkshopAddin(CAAEMmrCombinedCurveAdn);2.2.5 编制构造函数与析构函数2.2.6 定义命令标签(CreateCommands)和创建菜单/工具条(CreateToolbars)如:// Local Framework#include "CAAAfrGeoOperationAdn.h"// ApplicationFrame Framework#include <CA TCreateWorkshop.h>// Creates the CAAAfrGeoOperationAdnHeader command header class#include "CA TCommandHeader.h"MacDeclareHeader(CAAAfrGeoOperationAdnHeader);// To declare that the class// is a DataExtension of (late type) CAAAfrGeoOperationAddinCATImplementClass(CAAAfrGeoOperationAdn,DataExtension, CA TBaseUnknown,CAAAfrGeoOperationAddin(在接口字典中定义,见下句));// To create the TIE Object (即设置指向本插件的接口)(****)#include <TIE_CAAIAfrGeoCreationWkbAddin.h>TIE_CAAIAfrGeoCreationWkbAddin(CAAAfrGeoOperationAdn);// To declare that CAAAfrGeoOperationAddin implements CAAIAfrGeoCreationWkbAddin, insert// the following line in the interface dictionary: (???????功用)//CAAAfrGeoOperationAddin CAAIAfrGeoCreationWkbAddin libCAAAfrGeoCreationWkbAddin//---------------------------------------------------------------------------CAAAfrGeoOperationAdn::CAAAfrGeoOperationAdn(){}CAAAfrGeoOperationAdn::~CAAAfrGeoOperationAdn(){}void CAAAfrGeoOperationAdn::CreateCommands(){// Instantiation of the header class created by the macro MacDeclareHeader -// commands are always available and are represented by a push buttonnew CAAAfrGeoOperationAdnHeader("CAAAfrUnionHdr" ,"CommandLib","CommandName",(void *)NULL);new CAAAfrGeoOperationAdnHeader("CAAAfrSubstractHdr","CommandLib","CommandName",(void *)NULL);new CAAAfrGeoOperationAdnHeader("CAAAfrFilletHdr" ,"CommandLib","CommandName",(void *)NULL); }CATCmdContainer * CAAAfrGeoOperationAdn::CreateToolbars(){// CAAAfrOperationTlb ToolbarNewAccess(CATCmdContainer,pCAAAfrOperationTlb,CAAAfrOperationTlb);NewAccess(CATCmdStarter,pCAAAfrTUnionStr,CAAAfrTUnionStr);SetAccessCommand(pCAAAfrTUnionStr,"CAAAfrUnionHdr");SetAccessChild(pCAAAfrOperationTlb,pCAAAfrTUnionStr);NewAccess(CATCmdStarter,pCAAAfrTSubstractStr,CAAAfrTSubstractStr);SetAccessNext(pCAAAfrTUnionStr,pCAAAfrTSubstractStr);NewAccess(CATCmdStarter,pCAAAfrTFilletStr,CAAAfrTFilletStr);SetAccessCommand(pCAAAfrTFilletStr,"CAAAfrFilletHdr");SetAccessNext(pCAAAfrTSubstractStr,pCAAAfrTFilletStr);//----------------------// Menu bar (?????)NewAccess(CATCmdContainer,pCAAAfrOperationMbr,CAAAfrOperationMbr);// menu Tools with three new commandNewAccess(CATCmdContainer,pCAAAfrOperationToolsMnu,CA TAfrToolsMnu);SetAccessChild(pCAAAfrOperationMbr,pCAAAfrOperationToolsMnu);NewAccess(CATCmdSeparator,pCAAAfrOperationToolsSep,CAAAfrOperationToolsSep);SetAccessChild(pCAAAfrOperationToolsMnu,pCAAAfrOperationToolsSep);NewAccess(CATCmdStarter,pCAAAfrMUnionStr,CAAAfrMUnionStr);SetAccessCommand(pCAAAfrMUnionStr,"CAAAfrUnionHdr");SetAccessNext(pCAAAfrOperationToolsSep,pCAAAfrMUnionStr);NewAccess(CATCmdStarter,pCAAAfrMSubstractStr,CAAAfrMSubstractStr);SetAccessCommand(pCAAAfrMSubstractStr,"CAAAfrSubstractHdr");SetAccessNext(pCAAAfrMUnionStr,pCAAAfrMSubstractStr);NewAccess(CATCmdStarter,pCAAAfrMFilletStr,pCAAAfrMFilletStr);SetAccessCommand(pCAAAfrMFilletStr,"CAAAfrFilletHdr");SetAccessNext(pCAAAfrMSubstractStr,pCAAAfrMFilletStr);// Set the menu// pCAAAfrOperationTlb: Always the toolbar returned by the method// pCAAAfrOperationMbr: The container which contains all the menu's containersSetAddinMenu(pCAAAfrOperationTlb,pCAAAfrOperationMbr); (?????)// Invisible toolbarAddToolbarView(pCAAAfrOperationTlb,-1,Right);// Pointer of the first toolbar createdreturn pCAAAfrOperationTlb;}。
CATIA二次开发方法与实例

CATIA 二次开发方法与实例一、引言CATIA ( Computer Aided Three Dimensional Interaction Application System) ,计算机辅助三维/二维交互式应用系统) V5 就是IBM/DS 基于Windows 核心开发得高端CAD/CAM 软件系统。
目前CATIA 最新得版本为V6 。
CATIA 系统如今已经发展为集成化得CAD/CAE/CAM 系统,它具有统一得用户界面、数据管理以及兼容得数据库与应用程序接口,并拥 2 多个独立得模块。
在国内,CATIA 应用CAA 组件应用架构进行二次开发刚刚开始不久,相对人员比较少,资料不多,由于CATIA 软件功能得强大以及CAA 二次开发功能得强大,探索与实现基于CATIA 得二次开发技术具有很好得应用价值。
二、CATIA 得二次开发方式作为强大得工程软件,CATIA 具有很强得开放性能。
用户可以按照自己得需要,采用不同方式进行各种程度上得开发。
CATIA 二次开发接口就是通过两种方式与外部程序通信:进程内应用程序( In-process Application )方式与进程外应用程序( Out-Process Application )方式。
进程内应用程序方式下,CATIA 软件与脚本运行在同一进程地址空间,比如宏方式( Macro )。
在CATIA 环境下通过菜单记录宏( Record Macro ),宏记录后,生成VB 脚本( Visual Basic Script ) 序列,当宏开始运行,CATIA 就处于非激活状态,因此不能宏调用之间存储变量得值,这种方式比较简单,在CATIA 环境就中可完成。
进程外应用程序方式下,CATIA 与外部应用程序在不同进程地址空间运行。
在CATIA 运行得情况下,外部进程可以通过接口驾驭CATIA ,创建、修改CATIA 环境与几何形体得数据、尺寸等,同时支持对象连接与嵌入 (OLE ,Object Linking and Enbedding )。
CAA(V5R19)二次开发环境的配置

CAA(V5R19)二次开发环境的配置本教程旨在为广大CATIA V5R19二次开发初学者提供入门级别的学习,在学习本教程之前,需要自行下载CATIAV5R19安装软件、visual studio 2005软件、对应的CAA、RADE以及CATIA V5R19的破解程序和RADE破解程序。
进行二次开发工作,尤其是像CATIA这种非常大型的三维数模设计软件,软件的安装以及环境的配置给大多数学子带来了许多不必要的麻烦,恰好这种麻烦也是我们提升自身能力的重要阶段。
经过近三个月的摸索,对CATIA 二次开发从认识到实践、从陌生到熟悉,现将本阶段的学习过程及其中遇到的困难解答分享给广大读者。
首先,我们进行的是软件的安装及配置:一、安装Microsoft visual studio 2005(以下简称vs2005)1.vs2005包含了vb、.net、c#、c++.这里.net、c#、c++为必须安装项.2.需要安装MSDN帮助文档.二、安装CATIA V5R19 ([达索CATIA.v5R19.SP0.Dassault.Systemes].Catia.v5.r19.iso)1.安装虚拟光驱DAEMON Tools Lite(安装目录任意)2.使用虚拟光驱打开.iso文件,安装catia.(注意:安装目录为本地盘符的根目录,如D:catia_v5r19.)此时还不能打开CATIA,需要执行完破解文件之后才能打开(具体参考下一步).选择下一步选择下一步新建目标文件夹位于盘符根目录下目录不存在,选择新建点是输入标识,按照上面要求输入即可环境目录默认,选择下一步环境目录不存在,新建选择是选择完全安装,选择下一步默认不用更改,选择下一步默认不用更改,选择下一步选择下一步按照需要设置,选择下一步不安装联机文档,选择下一步选择安装,完成3.把破解文件(catia_v5r19sp0_x32_crk.exe)复制到D:catia_v5r19intel_acodein下,执行.选择Start三、安装CAA1.点击下一步2.CAA的安装目录选择catia的安装目录里3.选择完全安装4.点击安装5.提示插入第二张盘,将CAA第二张光盘映像文件载入虚拟光驱,然后点击确定6.完成界面最后,把include.rar解压到d:catia_v5r19.四、安装RADE1.点击下一步2.建立RADE的安装目录为盘符的根目录,与CATIA的目录平级,若提示找不到文件夹,则选择新建,然后点击下一步3.输入标识,按照要求输入即可4.选择环境目录为默认的目录,点击下一步,若提示没有目录,则选择新建5.选择完全安装,点击下一步6.默认,直接下一步7.点击安装8.完成。
CAA18完全安装指南
CAA R18安装指南1.安装CA TIA。
在安装CATIA时,要把它装到根目录下,文件夹名称不能含有空格,如F:\DassaultSystemes\B18。
安装完后,用crack文件下JS0GROUP.dll 拷贝到F:\DassaultSystemes\B18\intel_a\code\bin下覆盖。
2.安装VS2005。
装VS时选自定义,把里面的所有组件都选上。
安装完后按提示重启电脑。
3.安装CAA和rade。
先装CAA系统会自动安装到CA TIA文件夹下,再安装rade不要装在CATIA文件夹下,安装方法和安装CA TIA一样,文件名不能有空格。
//4至9步为crack操作,所涉及的文件在crack文件夹下4.安装winintel.zip 下的arkwin467.exe;5.将DSLicense200907.rar解压到C:\IFOR6.解压winintel.zip,并复制所有文件到C:\IFOR\win\bin7.将ChangeNodeForLUM.exe考入C:\IFOR\win\bin8.解压DSLicense2009.rar中的MAC.txt文件到C:\IFOR\win\bin目录9.由CMD进入dos操作界面,输入“CD C:\IFOR\win\bin”到指定目录(CD+空格+目录),运行ChangeNodeForLUM.exe MAC值10.修改系统时间至2010年1月2日//以下为注册等后续操作11.关闭service打开“开始/所有程序/License Use Runtime/service manger tool”选中列表中的服务条目,然后点service/stop12.打开“开始/所有程序/License Use Runtime/configuration tool”勾选第2和第3选项(如下图),其余都不选点NEXT在Name里填上完整的计算机名点next完成13.打开service打开“开始/所有程序/License Use Runtime/service manger tool”选中列表中的服务条目,然后点service/start14.打开“开始/所有程序/License Use Runtime/basic licence tool”快捷键ctrl+T在打开对话框里,路径为C:\IFOR\DSLicense200907\DSLicense200907下的所有LIC文件都选上,全部导入。
catiacaa应用开发的过程与方法
应用开发的过程与方法命名方法详见《应用开发中的命名规则》一、系统安装与环境配置1.1 系统安装1.1.1 VC++1.1.2 CATIA1.1.3 组建应用接口(CAA)1.1.4 快速应用开发环境(RADE)1.2 应用开发环境配置二、目录结构的建立2.1 创建工作空间(Workspace)In Microsoft Developer Studio open menu "File" and select "Open CAAV5 Workspace", the following window appears in which you can select to open your workspace with the "mkmk" functionalities.Either mode will give you access to the Code Generator features.Once you have filled in the workspace information, click on "OK". A log window appears while your environment is updated and the workspace opened. When this window has disappeared Developer Studio loads the project files it stored in your workspace and you are ready to work.The commands available in the Code Generator are a set of wizards wherein you specify a series ofparameters and it will generate code for you. Before creating the code, a report window appears so thatyou may verify that the code generated is as you expect it.You may find that some of the generated source files contain commented out statements such as "DO NOT EDIT :: THE CAA2 WIZARDS WILL INSERT CODE HERE". Do not modify what you find between these commented lines or the wizards will no longer be ableto insert code in the source file.2.2 定义组件框架(CAA V5 Framework/Implementation Framework)In Microsoft Developer Studio,open menu "Project" and select "New Framework…"The wizard will then create the following directory structure:Education type frameworks are suffixed ".edu" and Test frameworks are suffixed ".tst". The wizard appendsthese suffixes to the name of the framework.2.3 定义接口空间(Interface Framework)An interface framework is a framework that contains (mainly) interfaces in both C++ or IDL language. Thestructure of this interface is very specific. V5 naming conventions requires that these interfaces bedistinguishable through an "Interfaces" suffix. Therefore if you type in "Bird" in the framework name, thegenerated framework will be called "BirdInterfaces". The generated structure is the following:After the file structure has been created, the C++ Interactive Dashboard updates your Developer Studio project to take into account the new files and directories. In the Java Interactive Dashboard, you will see the new framework in the workspace tree view. Note that the framework is set as the currently activeproject.2.4 定义模块(Module)In Microsoft Developer Studio,open menu "Project" and select "New Module…"When you click on "OK" a report window is displayed to show you the files and directories that will be created. If you accept, the following file structure will be created:Note that the newly created module is set as the currently active module三、类定义Code Generator wizards enable you to create specific V5 objects that implement customary V5 patterns. These currently include:?Object modeler interfaces (both C++ and IDL)?Object modeler implementations?V5 documents?V5 features.InMicrosoft Developer Studio, source code is generated inthe currently active module. If the active project is not amodule, the following warning box will ask you to select anactive module. In Microsoft Developer Studio, this is doneby activating the contextual menu on the desired Microsoftproject ("Set as active project").When you generate source code using the Code Generator, your workspace is updated to take intoaccount the files newly created. In Developer Studio only, this often results in the following warning:This is an expected behaviour and it is safe to reload your project.3.1 CAA V5 C++类In Microsoft Developer Studio,open menu "Insert" and select "CAA V5 Class..." .It is recommended to use this command rather than using MsDev's own class creator because it takes into account the CAAV5 File Tree, as well as the standard macros included in the CAA classes.The wizard will create a header and a source file comprising a standard constructor and destructor, as wellas an equal operator and a copy constructor. The following files are created.3.2元件接口类(Object Modeler interfaces)Interfaces can be defined in C++ or in IDL (interface definition language).In Microsoft Developer Studio, open menu "Insert" and select "Interface..." .3.2.1 C++接口V5 naming conventions require that your interface have a 3 letter prefix, followed by the letter 'I' in upper case, followed by anything else, as in CATINavigateObject.3.2.2 IDL接口IDL interfaces can only be generated inside an Interface framework. The IDL radio button will be greyed out in any other type of framework.V5 naming conventions require that automation interface have a 3 letter prefix, followed by the letters IA in upper case, followed by anything else. The automationalias will be generated by extracting the XXXIA prefix from the interface name.When you click on "OK" a report window is displayed to show you the files that will be created. If you accept,the following files will be created (or affected):3.3元件实现类(Object Modeler Implementations)3.3.1 定义新元件Component implementations are written in C++. They cannot be included in interface frameworks...In Microsoft Developer Studio,open menu "Insert" and select "Component..."Even though you may create an implementation from either a C++ or an IDL interface, the wizard will not function on an uncompiled IDL header.If you directly type in the name of the interface you wish to implement, the command will prompt you to specify the header file that contains the definition of the interface. You may also ask the wizard to list all ofthe available interfaces in your workspace, or in your prerequisite workspaces (this may take some time asit parses all the interfaces in the workspace).When you click on "OK" a report window is displayed to show you the files that will be created. If you accept, the following files will be created:3.3.2 扩展现有元件The previous command also allows you to add new extensions to already existing implementations. You do this by checking the item "Extends" and by specifying which object you are extending.The generated objects for extensions are the same as for implementations.3.3.3 利用元件实现类构造工具(Implementation Wizard)When you develop a new implementation or extension, you may derive from another C++ class that already implements some of the functions of the interface you are implementing. As such, you have a choice between overloading those functionalites or not redefining them and using them as they have been defined in the base class. By default, the implementation builder will make you write all the methods of the interface. By using the wizard, you can choose between redefining those methods or not. (Of course, if the base class implements no method from the interface, using the wizard will not be of any use).The wizard push button is available as soon as you type in a base class different from CATBaseUnknown or CATIABaseObject. The wizard will then scan the base class to find if it implements any methods of the interface and will display them in a list3.4命令类(command)You may create several different types of new commands that you can add in your workshops:In Microsoft Developer Studio,open menu "Insert" and select "CATIA Resource/Command..."When specifying the name of a workshop (or workbench), the wizard will locate the code for that workshopand generate a command header for you. If no command header is found, a new type of header will be generated.Even though you have selected the "Include in workshop:" check, you will still need to use the "Customize" functionality of CATIA to access the command from your palette.3.5 对话框类(Dialog Object)You may create interactively a new dialog element based on the Dialog framework:In Microsoft Developer Studio,open menu "Insert" and select "CATIA Resource/Dialog..."Note that if you want to create a dialog-based command, you should use the " Command..." item of the "CATIA Resource" submenu of the "Insert" menu.When you select this command, a new page is inserted in your MsDev environment with a new and empty dialog. Refer to " Dialog builder features" for full documentation. 此处不明白!!!3.6测试实例(V5 Test-case)You may create interactively a new test case script inside a test-dedicated framework by using: In Microsoft Developer Studio,open menu "Insert" and select "Test-Case…"When you select this command, a new test case script is created in your framework. This test case can berun using the " Replay Test-Cases" command found in the "Build" menu.3.7交互界面(Workshop/Workbench)类The component builder currently only allows you to generate one type of V5 pattern: Workshops (or workbenches)In Microsoft Developer Studio,open menu "Insert" and select "CATIA Resource/CATIA Pattern..." You must first select the type of component you wish to create:3.7.1 工具导航条The wizard leads you through a series of panels wherein you are prompted for the caracteristics of theobject you wish to create. After filling in each panel, you can move on to the next panel using the wizardnavigation bar. When all the steps have been completed, you click on "Finish" to generate the component.3.7.2 定义交互界面类These are the steps to create a V5 workshop:四、源代码编制4.1 插件详见《插件的开发方法》4.2 命令详见《命令的开发方法》4.3 接口详见《接口的开发方法》4.4 对话框详见《对话框的开发方法》4.5 交互界面详见《交互界面开发》五、支撑框架设置(IdentiyCard.h)5.1 作用As almost all components (frameworks) are built upon others components, it is necessary ?To include at compile time the corresponding header files?To reference at link time the corresponding libraries.However the source files of a given component may include a lot of header files and, without the IdentityCard file, we must browse all the files to know the names of included header files and then find the names of the corresponding components.The IdentityCard file synthesizes those relationships between frameworks in order to get quickly the prerequisite frameworks.Warning: The IdentityCard file of any framework must at least contain a statement to set the System framework as a prerequisite framework up to its protected part, as follows: AddPrereqComponent ("System", "Protected");You must be aware that one user has often not all frameworks in his/her own workspace, and that most of the prerequisite frameworks he/she needs are located in others workspaces. Thanks to the IdentityCard file(s), tools like mkmk gain an easy way to determine and then access to prerequisite frameworks.The figure below gives a summary of the use of Identity Card files. An application ismade of components:?Built or not upon other components.?Using the CAA architecture each component is known as a framework possibly having prerequisite frameworks?Prerequisite frameworks of a given framework are specified in its Identity Card file.Note also that:?Every framework has an Identity Card file which can be empty if it does not need other component to implement its services. This is not shown in the figure.?Only frameworks that are directly used are specified in an Identity Card file.Remember the notions of public and private parts of a component: you don't knowhow a framework is implemented, so you shouldn't know its own prerequisites.5.2 保存位置Every framework must have an Identity Card file, named IdentityCard.h.This file is stored in directory IdentityCard, right under the framework root directory itself:. This file allows the framework to declare (the list of) its prerequisite frameworks.Conversely, to export one service a framework must just store the header file of itsservice in its PublicInterfaces directory.The IdentityCard.h file is a text file containing one line per prerequisite framework to declare.The syntax of a line is:AddPrereqComponent("<framework name>", Public);In the following example, source themine.cpp in framework1/module1 needs header otherservice.h which is neither in module module1, nor in framework1, but in another framework named framework2. Thus, framework1 needs to declare framework2 as a prerequisite in its identity card:The previous schema gives an example of a prerequisite between code frameworks, you can also have:? A prerequisite between an education framework (.edu) and a code framework - when the education framework contains code samples which need codeframeworks to be implemented.? A prerequisite between an education framework and others education frameworks - if the first framework contains documents which refer to documents managed inothers frameworks.六、编译与连接6.1 确定支持框架6.2 确定连接库文件添加Imakefile.mk文件中所需库名6.3 编译与连接7.1 资源提取7.2 执行文件设置7.3 运行相关资料[1] Customize Developer Studio[2] Working with Developer Studio[3] Workbench Commands Mapping[4] Dialog builder features[5] 插件的开发方法[6] 命令的开发方法[7] 接口的开发方法[8] 对话框的开发方法[9] 交互界面的开发方法【下载本文档,可以自由复制内容或自由编辑修改内容,更多精彩文章,期待你的好评和关注,我将一如既往为您服务】。
CATIA-CAA二次开发教程
CATIA CAA V5R19 二次开发详细教程CAA,全称C omponent A pplication A rchitecture,组件应用架构。
CAA架构CATIA本身是按照组件模型建立起来的,用户可以通过开发自己的CAA组件,对DASSAULT SYSTEMES的CATIA V5进行扩展;也可以把用户自己开发的CAA组件结合起来,实现用户自定义应用。
CAA应用的框架结构遵从组件对象模型,有自己的框架结构。
每个应用有至少一个框架(framework),每个框架有至少一个模块(module)。
每个框架里面有一个IdentityCard.h 文件,这个文件通过宏“AddPrereqComponent(framenwork,protected)”来声明“声明”这个框架的一些首先必备的其他框架名称,framework是框架名称。
CAA的编译器就是通过IdentityCard.h文件,来把头文件搜索限制在首先必备框架所包含的接口中。
每个模块下面定义了一个Imakefile.mk文件,这个文件指明了这个模块中所有文件在编译时用到的其它模块和一些外部库以及为编译器提供如何编译的模块必须信息,还指定在不同的操作系统下面编译时的一些可能的特殊要求。
CAA环境对Cnext能够运行的所有操作系统中采用同样的编译器,这为开发者提供了很大的方便,因为他们可以不需要知道怎样用不同的编译器和怎么写makefile。
但是MKMK并不能做所有的事情,开发者至少要说明他们想要做什么。
我们在自己的源文件中用到其它模块的接口,要在Imakefile.mk中进行说明。
程序结构采用了COM组件模型,组件模型中有两个常用的概念:接口(Interface)和实现(Implement)。
接口是一个包含许多纯虚函数的抽象对象,这些纯虚函数指明了接口支持的方法。
实现是一个具体定义接口中的方法的对象,一个实现对象必须显式声明它支持哪些接口,还必须定义它支持的接口中的所有抽象方法,实现对象可以支持一个或多个接口,而客户应用只能通过这些接口与实现对象发生联系。
CATIACAA二次开发详细教程
CATIA CAA 二次开发详细教程第一讲:基本概念1. 什么是组件?由于本人是自学,属于摸着石头过河,所以很多东西显得比较幼稚,大家请见谅。
CAA,全称 C omponent A pplication A rchitecture,组件应用架构。
这个东西对不搞软件的人来说可能很陌生,我也很陌生啊,原来光知道“面向对象的技术”就很牛逼了,“组件技术”难道更牛逼吗?既然类和组件有着这么多类似的地方,那么传统的面向对象编程和面向组件编程有什么区别呢?简单的说,面向对象关注的是组合在一个二进制可执行文件中的各个类的关系,而面向组件的编程关注的是在彼此独立的基础上模块之间的交互性,这种交互性使得你并不需要熟悉它们内部的工作原理。
这两种方法最基本的不同在于它们对最终的应用程序的观点。
在传统的面向对象编程中,尽管你可以精心的把所有的商业逻辑分布在不同的类中,一旦这些类被编译,它们就被固化成了一个巨大的二进制代码。
所有的类共享同一个物理单元(通常是一个可执行文件)、被操作系统认为是同一个进程,使用同一个地址空间以及共享相同的安全策略等等。
如果多个开发者在同一份代码上进行开发,他们甚至还要共享源文件。
在这种情况下,修改一个类可能会让整个项目被重新链接,并重新进行必要的测试,更严重的,还有可能要修改其他的类。
但是,在面向组件开发中,应用程序是由一系列可以互相交互的二进制模块组合而成的。
一个具体的二进制组件可能并不能完成什么工作。
有些组件是为了提供一些常规服务而编写的,例如通信的封装或者文件访问组件。
也有一些是为了某些特定应用而专门开发的。
一个应用程序的设计者可以通过把这些不同的组件提供的功能粘合在一起来实现他们需要的商业逻辑。
很多面向组件的技术——例如: COM 、 J2EE 、 CORBA 和 .NET 都为二进制组件提供了的无缝链接的机制。
而唯一的不同就是你需要在组件通信上花费的力气。
把一个二进制应用程序分解成不同的二进制组件的动机和把不同的类放到不同的文件中是类似的。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
CAA+RADE+VS安装及环境配置
本教程旨在为广大CA TIA二次开发初学者提供入门级别的学习,在学习本教程之前,需要自行下载catia安装软件、visual studio 2005软件、CAA、RADE以及catia破解程序和RADE 破解程序.作为一名数字化制造技术的研究者,我与大多数学子一样是一名刚从本科毕业,现在进入研究生阶段的学习.在接触新事物之前,尤其对于程序开发人员,专业软件的安装以及环境的配置给大多数学子带来了许多不必要的麻烦,恰好这种麻烦也是我们提升自身能力的重要阶段.经过近三个月的摸索,对CATIA二次开发从认识到实践、从陌生到熟悉,现将本阶段的学习过程及其中遇到的困难解答分享给广大读者,希望大家对其中的错误以及不足提出宝贵的意见(发送邮件至***************).谢谢!
首先,我们进行的是软件的安装及配置:
一、安装Microsoft visual studio 2005(以下简称vs2005)
1.vs2005包含了vb、.net、c#、c++.这里.net、c#、c++为必须安装项.
2.需要安装MSDN帮助文档.
二、安装CATIA V5R19 ([达索CATIA.v5R19.SP0.Dassault.Systemes].Catia.v5.r19.iso)
1.安装虚拟光驱DAEMON Tools Lite(安装目录任意)
2.使用虚拟光驱打开.iso文件,安装catia.(注意:安装目录为本地盘符的根目录,如D:\catia_v5r19.)此时还不能打开CATIA,需要执行完破解文件之后才能打开(具体参考下一步).
选择下一步
选择下一步
新建目标文件夹位于盘符根目录下
目录不存在,选择新建点是
输入标识,按照上面要求输入即可
环境目录默认,选择下一步环境目录不存在,新建选择是
选择完全安装,选择下一步默认不用更改,选择下一步
默认不用更改,选择下一步选择下一步
按照需要设置,选择下一步不安装联机文档,选择下一步
选择安装,完成
3.把破解文件(catia_v5r19sp0_x32_crk.exe)复制到D:\catia_v5r19\intel_a\code\bin下,执行. 选择Start
三、安装CAA
1.点击下一步
2.CAA的安装目录选择catia的安装目录里
3.选择完全安装
4.点击安装
5.提示插入第二张盘,将CAA第二张光盘映像文件载入虚拟光驱,然后点击确定
6.完成界面
最后,把include.rar解压到d:\catia_v5r19.
四、安装RADE
1.点击下一步
2.建立RADE的安装目录为盘符的根目录,与CATIA的目录平级,若提示找不到文件夹,则选择新建,然后点击下一步
3.输入标识,按照要求输入即可
4.选择环境目录为默认的目录,点击下一步,若提示没有目录,则选择新建
5.选择完全安装,点击下一步
6.默认,直接下一步
7.点击安装
8.完成。
9.RADE安装完成之后要进行注册,按照以下步骤注册:
(1)将rade破解文件解压(LaunchCommandControl.exe、mkmkM.exe、mkstepM.exe、ReleaseServer.exe)并复制到D:\RADE\intel_a\code\bin并替换之前的文件
(2)将D:\catia_v5r19\intel_a\code\bin下JS0GROUP.dll文件复制到D:\RADE\intel_a\code\bin下,并替换之.
10.运行D:\RADE\intel_a\code\bin目录下的CATVBTLicenser.exe文件出现以下界面,选中右边所有选项并点击Apply
11.正确提示如下
然后,进行的是开发环境的搭建:
一、运行D:\RADE\intel_a\code\bin下的CATVBTSetup.exe,忽略提示。
Target 选项下:Installation Directory选择CA TIA的安装目录
Documentation选项下:Documentation installation Path设置为D:\catia_v5r19\CAADoc\Doc 验证消息点击OK
完成界面
二、在注册完过后,启动visual studio 2005
三、在catia的安装目录下新建一个工作空间CAAWorkspaceR19,将CAADoc文件夹下的 文件夹复制到CAAWorkspaceR19文件夹下
四、点击vs2005的文件菜单,选择Open CAA V5 Workspace
With后面选择Mkmk
Workspace Directory选择上面新建的文件夹路径如图
Tool level选择V5R19_B19
点击OK
警告信息,点击OK
提示工作空间里无工程,点击确定
展开树形结构文件选择CAASysCallBack.m,点击OK,vs2005解决方案里显示如下信息
菜单显示为如下:
在CAA V5Workspace菜单下,点击Locate Prerequisite Workspaces...如下
Mode下面选择Access prerequisites from their origin location,
Origin for prerequisite Frameworks里点击Add,选择CAA CATIA V5的安装文件夹路径点击OK,将会出现如下画面
点击close
在生成菜单下,点击mkmk,将会出现Code Builder(mkmk)界面
在Update makefiles (-u)前面打勾,按+号展开树形结构,选择CAASysCallBack.m 点击OK
此时将会出现生成界面如下
在CAA V5Workspace菜单下,选择Create/Update Runtime View....
出现Create RunTimeView界面
点击OK
出现如下界面
最后,我们需要将CAASysCallback.m 工程设为启动工程:右键点击CAASysCallback.m ,选择设为启动工程。
现在我们运行项目:点击调试菜单下面的开始执行(不调试)选项
此时会提示如下错误
这是因为我们的工程里面还没有设置一些编译需要的参数
说明:catia开发包提供了很多例子位于D:\catia_v5r19\B19\CAADoc目录,CAA帮助文档D:\catia_v5r19\B19\CAADoc\Doc\online\CAACenV5Title.htm,此帮助文档需要在本机安装java JDK1.5及以上版本。