教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 资格考试 >

CATIA CAA 二次开发 详细教程(5)添加一个点(3)

来源:网络收集 时间:2026-01-25
导读: CATIA CAA 二次开发 详细教程 ed 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);

CATIA CAA 二次开发 详细教程

ed 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 << \ } else {

cout << \ 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 << \ } else {

cout << \ 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 Type

CATProduct_OmbExportType CATIExportTypeManager libCAAOmbExportType

40

CATIA CAA 二次开发 详细教程

A 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 \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 CAAEOmbExportType

Data as a code extension implementing the CATProduct_OmbExportType late type. #include \

TIE_CATIExportTypeManager( CAAEOmbExportTypeData );

The above statement indicates that this is an implementation of the CATIExportTypeManager interface.

HRESULT CAAEOmbExportTypeData::ExportData ( CATDocument *pDoc,

CATUnicodeString path ) {

cout << \ 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 o

perations necessary for your new document type.

41

CATIA CAA 二次开发 详细教程

CATIA CAA 二次开发详细教程(11) 程序的发布

1. 发布条件:

已安装了CATIA,版本不能低于开发使用的CAA版本。 CAA代码成果物“intel_a”文件中的所有文件。

1. 发布方法:

2. 将“intel_a”文件存放在要发布机器上,存放“intel_a”文件的路径最好不要有中文字符和空格。(例:E:\\VCINewFromExisting\\intel_a)

3. 点击 ”开始” –> ”所有程序” –> “CATIA P3” –> “Tools” –>” Environment Editor V5R18”

1. 点击 “确定”。

42

CATIA CAA 二次开发 详细教程

1. 选择”Environment” –> “New”

1. “Name” 栏为将要创建的桌面快捷方式的名称;在”Install Path” 栏中,CATIA的安装路径后输入”; E:\\VCINewFromExisting\\intel_a”,这是要发布的intel_a的存放路径;其他如图所选,采取默认设置。完成后点击”OK”。

1. 至此发布完成,在桌面上会生成一个名为”NewFromExisting”的CATIA类型图标。双击该图标,会启动CATIA,用户便可使用CATIA原所有功能和新发布的功能。

1. 与原CATIA图标集成发布方法: 设:

Catia的工作目录是 D:\\DS\\B18\\intel_a; 已开发插件的工作目录是D:\\MyAddin\\intel_a;

将D:\\MyAddin\\intel_a下这些文件复制到D:\\DS\\B18\\intel_a对应的位置,即可在运行Catia时候自动加载插件:

43

CATIA CAA 二次开发 详细教程

code \\ bin \\ *.dll; \\ code \\dictionary \\ *.dico; \\ code \\ productIC \\ *.script; \\ code \\ productIC \\ *.xml;

\\ resources \\ graphic \\ icons \\ normal \\ *.bmp; \\ resources \\ msgcatalog \\ *.CATNls; \\ resources \\ msgcatalog \\ *.CATRsc;

44

…… 此处隐藏:1840字,全部文档内容请下载后查看。喜欢就下载吧 ……
CATIA CAA 二次开发 详细教程(5)添加一个点(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/412017.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)