第一范文网 - 专业文章范例文档资料分享平台

CATIA二次开发 (4)

来源:用户分享 时间:2020-06-17 本文由撞进先生怀里 分享 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

This toolbar contains four commands: Cuboid, Sphere, Torus, and Cylinder. You should, for each command: (1)Create a command starter using the NewAccess macro (2)Associate the command starter, using the SetAccessCommand macro, with the appropriate command header identifier defined in the CreateCommands method (3)Arrange the command starters in the toolbar using the SetAccessChild and SetAccessNext macros

... NewAccess(CATCmdStarter,pCAAAfrTSolidEltCuboidStr,CAAAfrTSolidEltCuboidStr); SetAccessCommand(pCAAAfrTSolidEltCuboidStr,\SetAccessChild(pCAAAfrSolidEltTlb,pCAAAfrTSolidEltCuboidStr);

NewAccess(CATCmdStarter,pCAAAfrTSolidEltSphereStr,CAAAfrTSolidEltSphereStr); SetAccessCommand(pCAAAfrTSolidEltSphereStr,\SetAccessNext(pCAAAfrTSolidEltCuboidStr,pCAAAfrTSolidEltSphereStr); NewAccess(CATCmdStarter,pCAAAfrTSolidEltTorusStr,CAAAfrTSolidEltTorusStr); SetAccessCommand(pCAAAfrTSolidEltTorusStr,\SetAccessNext(pCAAAfrTSolidEltSphereStr,pCAAAfrTSolidEltTorusStr);

NewAccess(CATCmdStarter,pCAAAfrTSolidEltCylinder1Str,CAAAfrTSolidEltCylinder1Str); SetAccessCommand(pCAAAfrTSolidEltCylinder1Str,\SetAccessNext(pCAAAfrTSolidEltTorusStr,pCAAAfrTSolidEltCylinder1Str);

NewAccess(CATCmdStarter,pCAAAfrTSolidEltCylinder2Str,CAAAfrTSolidEltCylinder2Str); SetAccessCommand(pCAAAfrTSolidEltCylinder2Str,\SetAccessNext(pCAAAfrTSolidEltCylinder1Str,pCAAAfrTSolidEltCylinder2Str); ...

Three macros are required for each command. For example, the Cuboid command is processed as follows:

10

1) First create the command starter as a CATCmdStarter instance using the NewAccess macro. pCAAAfrTSolidEltCuboidStr is the variable used to handle a pointer to that instance, and CAAAfrTSolidEltCuboidStr is its identifier. 2) Then associate the Cuboid command header with this command starter using the

SetAccessCommand macro. The second parameter is the Cuboid command header

identifier defined as the first parameter of the command header consrtuctor. Refer to Creating the Command Headers 3) Finally set the Cuboid command starter as the child of the Solids toolbar. Proceed in the same way for the other commands, except that they are set as next of one another using the SetAccessNext macro. 2)添加 Surfaces 工具条按钮(Creating the Surfaces Toolbar Content)

This toolbar contains three commands: Revolution Surface, Nurbs Surface, and Offset Surface. You should, for each command: (1)Create a command starter using the NewAccess macro (2)Associate the command starter, using the SetAccessCommand macro, with the appropriate command header identifier defined in the CreateCommands method (3)Arrange the command starters in the toolbar using the SetAccessChild and SetAccessNext macros ... NewAccess(CATCmdStarter,pCAAAfrTSurfRevolStr,CAAAfrTSurfRevolStr); SetAccessCommand(pCAAAfrTSurfRevolStr,\SetAccessChild(pCAAAfrSurfacicEltTlb,pCAAAfrTSurfRevolStr);

NewAccess(CATCmdStarter,pCAAAfrTSurfNurbsStr,CAAAfrTSurfNurbsStr); SetAccessCommand(pCAAAfrTSurfNurbsStr,\SetAccessNext(pCAAAfrTSurfRevolStr,pCAAAfrTSurfNurbsStr);

NewAccess(CATCmdStarter,pCAAAfrTSurfOffsetStr,CAAAfrTSurfOffsetStr);

SetAccessCommand(pCAAAfrTSurfOffsetStr,\SetAccessNext(pCAAAfrTSurfNurbsStr,pCAAAfrTSurfOffsetStr); ...

Three macros are required for each command. For example, the Revolution Surface command is processed as follows: (1)First create the command starter as a CATCmdStarter instance using the NewAccess macro.

pCAAAfrTSurfRevolStr is the variable used to handle a pointer to that instance, and CAAAfrTSurfRevolStr is its identifier. 11

(2)Then associate the Revolution Surface command header with this command starter using the

SetAccessCommand macro. The second parameter is the Revolution Surface command header identifier

defined as the first parameter of the command header consrtuctor. Refer to Creating the Command Headers (3)Finally set the Revolution Surface command starter as the child of the Surfaces toolbar. Proceed in the same way for the other commands, except that they are set as next of one another using the SetAccessNext macro. 3)添加菜单项(Creating the Menu Bar Content) Menus and submenus are created as CATCmdContainer instances, and menu items as CATCmdStarter instances. The menu bar you create will be merged when the workbench is loaded or activated at run time with the workshop menu bar, itself resulting in the merge of the default menu bar, that is, the one that exists when no document is active, with the one defined for the workshop. You can neither remove a menu from the default menu bar or from the menu bar defined for the workshop, nor change the menu order. You can add submenus to menus. You can also add submenus to your own submenus, but not to existing submenus.

You should: (1)Create a command container for each menu and submenu using the NewAccess macro (2)Create a command starter for each command using the NewAccess macro (3) Associate each command starter, using the SetAccessCommand macro, with the appropriate command header identifier defined in the CreateCommands method (4)Arrange the command starters in the menu using the SetAccessChild, and SetAccessNext macros ——Insert Menu - Solids Submenu

... NewAccess(CATCmdContainer,pCATAfrInsertMnu,CATAfrInsertMnu); SetAccessChild(pCAAAfrGeoCreationMbr,pCATAfrInsertMnu);

NewAccess(CATCmdSeparator,pCAAAfrGeoCreationInsertSep,CAAAfrGeoCreationInsertSep); SetAccessChild(pCATAfrInsertMnu,pCAAAfrGeoCreationInsertSep); NewAccess(CATCmdContainer,pCAAAfrSolidEltSnu,CAAAfrSolidEltSnu); 12

SetAccessNext(pCAAAfrGeoCreationInsertSep,pCAAAfrSolidEltSnu);

NewAccess(CATCmdStarter,pCAAAfrMSolidCuboidStr,CAAAfrMSolidCuboidStr); SetAccessChild(pCAAAfrSolidEltSnu,pCAAAfrMSolidCuboidStr); SetAccessCommand(pCAAAfrMSolidCuboidStr,\

NewAccess(CATCmdStarter,pCAAAfrMSolidSphereStr,CAAAfrMSolidSphereStr); SetAccessNext(pCAAAfrMSolidCuboidStr,pCAAAfrMSolidSphereStr); SetAccessCommand(pCAAAfrMSolidSphereStr,\

NewAccess(CATCmdStarter,pCAAAfrMSolidTorusStr,CAAAfrMSolidTorusStr); SetAccessNext(pCAAAfrMSolidSphereStr,pCAAAfrMSolidTorusStr); SetAccessCommand(pCAAAfrMSolidTorusStr,\

NewAccess(CATCmdStarter,pCAAAfrMSolidCylinder1Str,CAAAfrMSolidCylinder1Str); SetAccessNext(pCAAAfrMSolidTorusStr,pCAAAfrMSolidCylinder1Str); SetAccessCommand(pCAAAfrMSolidCylinder1Str,\

NewAccess(CATCmdStarter,pCAAAfrMSolidCylinder2Str,CAAAfrMSolidCylinder2Str); SetAccessNext(pCAAAfrMSolidCylinder1Str,pCAAAfrMSolidCylinder2Str); SetAccessCommand(pCAAAfrMSolidCylinder2Str,\

The Insert menu command container is created, even if it already exists. Then the Solids submenu command container is created and set as the child of the Insert menu command container. Since no other positioning information is given, it should lay below the last submenu or command of the workshop menu bar, that is the Plane command. Then the Cuboid command starter is created and set as the child of the Solids submenu command container, and the others are cretaed and set next of one another. ——Insert Menu - Surfaces Submenu ... NewAccess(CATCmdContainer,pCAAAfrSurfacicEltSnu,CAAAfrSurfacicEltSnu) ; SetAccessNext(pCAAAfrSolidEltSnu,pCAAAfrSurfacicEltSnu);

NewAccess(CATCmdStarter,pCAAAfrMSurfRevolStr,CAAAfrMSurfRevolStr); SetAccessChild(pCAAAfrSurfacicEltSnu,pCAAAfrMSurfRevolStr); SetAccessCommand(pCAAAfrMSurfRevolStr,\NewAccess(CATCmdStarter,pCAAAfrMSurfNurbsStr,CAAAfrMSurfNurbsStr); SetAccessNext(pCAAAfrMSurfRevolStr,pCAAAfrMSurfNurbsStr); SetAccessCommand(pCAAAfrMSurfNurbsStr,\ 13

NewAccess(CATCmdStarter,pCAAAfrMSurfOffsetStr,CAAAfrMSurfOffsetStr);

搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新经管营销CATIA二次开发 (4)全文阅读和word下载服务。

CATIA二次开发 (4).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/wenku/1082513.html(转载请注明文章来源)
热门推荐
Copyright © 2018-2022 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top