Tutorials to .com

Tutorials to .com » Mechine » Autocad » CATIA's interface based on the secondary development of methods and examples

CATIA's interface based on the secondary development of methods and examples

Print View , by: iSee ,Total views: 75 ,Word Count: 3093 ,Date: Sun, 16 Aug 2009 Time: 10:04 PM


CATIA (Computer Aided Three & Two Dimensional Interaction application System, Computer-Aided Three-dimensional / two-dimensional Interactive Application) V5 is IBM / DS the core of the development of Windows-based high-end CAD / cam software systems. At present, the latest version of CATIA for V5R14. CATIA system has now been developed into integrated CAD / CAE / CAM system, it has a unified user interface, data management, as well as compatible with the database and application programming interfaces, and has more than 20 separate modules.

At home, CATIA Application architecture Component Application CAA to carry out the second development has just begun, relatively fewer staff, very little information is available, as a powerful CATIA software, as well as the secondary development of CAA powerful features to explore and the second based on CATIA the development of technology has a very good value.

Second, CATIA way the secondary development of

As a powerful engineering software, CATIA has a strong opening performance. Users according to their own needs, using a variety of different ways the extent of development.

CATIA is a secondary development interface in two ways communication with external procedures: the application process (In-process Application) approach and the application process (Out-Process Application) approach. Application process under way, CATIA software and scripts to run in the same process address space, such as macro mode (Macro). In the CATIA environment through the menu macro record (Record Macro), macro recorder, the generation of vb Script (Visual Basic Script) sequence, when the macro is running, CATIA on in a non-activated state and therefore could not call the macro variable's value between the storage, This approach is relatively simple, in the CATIA environment, can be completed. Application process under way, CATIA and external applications in different process address space to run. Operation in CATIA, the external process control through the interface CATIA, create, modify, CATIA environment and geometry data, size, etc. At the same time, support for Object Linking and Embedding (OLE, Object Linking and Enbedding).

Specifically, CATIA secondary development There are two main methods: the use of CATIA macro development and use of a second Component Application Architecture (CAA-RADE) for the secondary development of CATIA.

1, the use of macros (Macro) for the secondary development of CATIA.

Can be used for automation (Automation) components, as the editing tool to use VBScript, which is a customized interactive. Can record the user's operation, auto-generated code. CATIA provides the Automation API for vbscript for CATIA secondary development, Automation API has by any OLE-compatible communications platform. Automation interface can be called "InputBox" and "MsgBox" function to get the user input information and output, and for NT users can be applied to Visual Basic to the definition of more complex input and output panels. Running time can be an icon associated to the macro and display the framework into CATIA. In this way the development process as shown in Figure 1.

CATIA's interface based on the secondary development of methods and examples

Figure 1 the use of VB for CATIA secondary development of the basic processes

2, using the Component Application Architecture (CAA-RADE) for the secondary development of CATIA

Component Application Architecture (CAA) Component Application Architecture, is the expansion of Dassault Systemes products and customers a powerful tool for secondary development. CAA provided by Dassault Systemes products include the following:

CAA RADE rapid development environment, based on Microsoft Visual Studio & # 61548;

CAA CATIA V5 API, CATIA V5 application development tools & # 61548;

CAA ENOVIA LCA V5 API, ENOVIA LCA application development tools & # 61548;

CAA DELMIA V5 API, DELMIA V5 application development tools & # 61548;

CAA ENOVIA PORTAL V5 API, ENOVIA PORTAL V5 application development tool

Rapid application development environment for Rapid Application Development Environment (RADE) is a visual integrated development environment, which provides a complete programming tool. RADE to Microsoft Visual c + +6.0 as a carrier, fully integrated development tools in the vc + + environment, and provides a framework of procedures CAA compiler, but it also limits the part of VC + + function. It can be said that CATIA CAA-RADE is all high-end CAD / CAM in the most complex development environment, but also one of the most powerful.

CAA the use of object-oriented programming language, development process can be seen as a combination of its components and expansion of the object. CAA using CAA the use of Component Object Model object-oriented programming language, development process can be seen as a combination of its components and expansion of the object. CAA the use of Component Object Model (COM) and object linking and embedding (OLE) technology, CAA structure as shown in Figure 2.

CATIA's interface based on the secondary development of methods and examples

Figure 2 CAA framework

Third, the use of the CATIA Application Architecture component interface methods of the second development

The following example shows how to use the CAA C++ + + development methods to build a CATIA internal procedures. Function is to achieve an independent new table (workbench), and in its achievement of the following to add a custom menu and add toolbar button icon, insert CATIA dialog box style. And generate the response of the interface functions, the establishment of command, call the realization of the dialog box, as well as the input parameters through the direct use of the code to generate a three-dimensional model, and in the main window CATIA.

1, a new independent workbench

CATIA V5 will be certain types of orders contains a series of interactive tools is displayed in different sub-section of the table (workbench), so that will help to find and use tools. Through their new workbench can be formed by secondary development of their own series of commands are displayed in a focus on the work of Taichung, to facilitate the operation of the future. The establishment of the need to table the following steps.

Create table works (factory) of the interface (interface);

Create table plants;

Create table category description;

Created in response to an order (command) the title;

Workbench to create and Arrange Icons by button response;

Prompted to provide resources such as pictures and the table and insert the new Start menu;

Create a table display interface.

Insert the new CATIA workbench MyWorkBench after the Start menu as shown in Figure 3, with CATIA modules available become parallel. We will now proceed to table MyWorkBench tools inside and there is no button to add this part of the following tools.

Generated a new table

2, add toolbars and buttons

Button to create a description of the first category CAAAfrGeoCreationWkb, derived from CATBaseUnknown category. CATBaseUnknown is to create the user interface and to achieve the base class interface, all from the interface IUnknown / CATBaseUnknown succession. The establishment of this category were two CATCmdWorkbench * function of CreateWorkbench () function and return value types of CreateCommands (). In front of the function is used to fulfill the order of insertion tool, the button icon and the menu, after the realization of the function button on the Insert menu and response functions, as well as the link.

In CreateWorkbench () function used in the macro NewAccess (className, variableName, objectName). CATIA field of work (workshop) or table (workbench) can be seen as a collection of imported packages, the use of NewAccess can create a macro to do the entrance. The use of SetAccessChild (variableName, childName), as well as SetAccessNext (variableName, nextName) of these two macros you can connect the entrance. ClassName that is created in which the type of category, which includes the following types: CATCmdContainer, CATCmdWorkshop, CATCmdSeparator, CATCmdStarter. The following is a button to create the container, that is, toolbar, and add some of the code button.

NewAccess (CATCmdContainer, pCAAAfrTB1EltTlb, CAAAfrTB1EltTlb); / / create a toolbar pCAAAfrTB1EltTlb

SetAccessChild (pCAAAfrGeoCreationWkb, pCAAAfrTB1EltTlb); / / tool to be added to the table

/ / Create a button cmd1, and set up its response to macro for CAAAfrCmd1Hdr, the last to add toolbar in TB1

NewAccess (CATCmdStarter, pCAAAfrTTB1EltCmd1Str, CAAAfrTTB1EltCmd1Str);

SetAccessCommand (pCAAAfrTTB1EltCmd1Str, "CAAAfrCmd1Hdr");

SetAccessChild (pCAAAfrTB1EltTlb, pCAAAfrTTB1EltCmd1Str);

Next draw an icon and its associated CAAAfrGeoCreationWkbHeader.CATRsc will be as follows, the cmd1 button shows the icon CAACmd1.Bmp.

CAAAfrGeoCreationWkbHeader.CAAAfrCmd1Hdr.Icon.Normal = "I_CAACmd1";

CAAAfrGeoCreationWkbHeader.CATNls document in a new set of title buttons, as well as tips content

CAAAfrGeoCreationWkbHeader.CAAAfrCmd1Hdr.Category = "Element";

CAAAfrGeoCreationWkbHeader.CAAAfrCmd1Hdr.Title = "command1";

CAAAfrGeoCreationWkbHeader.CAAAfrCmd1Hdr.ShortHelp = "new cmd1";

Add two toolbar button and insert the effect of a series of plans such as the following shown in Figure 4.

CATIA's interface based on the secondary development of methods and examples

Figure 4, 5 to add the button to add a new menu

3, add the menu

Menu with the Add button to add a similar, but also in CreateWorkbench () function, only the parameters in the macro and not the same as the Add button. After adding the effect of map shown in Figure 5

NewAccess (CATCmdContainer, pCAAAfrGeoCreationMbr, CAAAfrGeoCreationMbr);

NewAccess (CATCmdContainer, pCATAfrInsertMnu, CATAfrInsertMnu);

SetAccessChild (pCAAAfrGeoCreationMbr, pCATAfrInsertMnu);

NewAccess (CATCmdSeparator, pCAAAfrGeoCreationInsertSep, CAAAfrGeoCreationInsertSep);

SetAccessChild (pCATAfrInsertMnu, pCAAAfrGeoCreationInsertSep);

NewAccess (CATCmdContainer, pCAAAfrMeu1EltSnu, CAAAfrMeu1EltSnu);

SetAccessNext (pCAAAfrGeoCreationInsertSep, pCAAAfrMeu1EltSnu);

NewAccess (CATCmdStarter, pCAAAfrMMeu1SubMn1Str, CAAAfrMMeu1SubMn1Str);

SetAccessChild (pCAAAfrMeu1EltSnu, pCAAAfrMMeu1SubMn1Str);

SetAccessCommand (pCAAAfrMMeu1SubMn1Str, "CAAAfrCmd1Hdr");

CAAAfrGeoCreationWkb.CATNls document in the display properties settings menu.

CAAAfr Meu1EltSnu.Title = "New Menu 1";

CAAAfr Meu1EltTlb.Title = "command1";

3, as well as the establishment of the menu button to respond to category

Built the framework of workbench space can create three types of response (command) type, they are derived CATCommand. Add specific CAA Rade process is to open the menu "Insert", select "CATIA Resource" under the "Command ..."。 Can choose to Statechart command, dialog-box based command and Basic command. Basic command is to create an empty response categories, in the function Activate (CATCommand * iFromClient, CATNotification * iEvtDat) Add to respond.

dialog-box based command in the second development will be used more. Select the type of response categories, when in operation will directly pop up a dialog box, of course, can be edited on this dialog box. Edit interface dialog box as shown in Figure 6, which has a dialog box is being edited in the middle of map, the right is the number of self-control, including CATDlgFrame, CATDlgLabel, CATDlgEditor, CATDlgPushButton, CATDlgRadioButton and so on. Dialog box controls all the Build () function are listed, the application function SetGridConstraints (short int iTopRow, short int iLeftColumn, short int iRowSpan, unsigned int iJustification) by setting the control matrix in the dialog box to adjust the location of the way location.

Add a callback function for the controls to respond to a variety of operations. Shown in figure 7, CATDlgPushButton button controls including the Creation, Visibility swap, Resizement, Button activation and Repetitive button activation5 in the callback function. Click Select Button activation generated in response to a callback function to generate OnPushButton004PushBActivateNotification (CATCommand * cmd, CATNotification * evt, CATCommandClientData data), can add the code within this function.

CATIA's interface based on the secondary development of methods and examples

Figure 6, 7 dialog editor dialog control callback function to add

Fourth, the development of examples of

1, through the input parameters of the examples drawn body stretch can be generated according to their own needs as well as other complex tensile model and the realization of the process parameters, in this case, by entering the radius of circular cross-section, stretching the length as well as the tensile direction and angle section method to generate the tensile body, and can change its location. Shown in Figure 8.

CATIA's interface based on the secondary development of methods and examples

Figure 8 Tensile button mapping dialog box in response to body

2, five coordinates CNC machine tool motion simulation. The realization of the digital machine tool and machine modeling of the motion simulation, and on this basis to achieve more functionality and simulation module. Simulation results after the completion of the map as shown in Figure 9, Figure 10 and Figure 11 respectively, as well as local effects of the display of tool path.

First of all, create a new independent table, in the months following the establishment of two modules: module machine modeling and motion simulation module. For each module required for the establishment of their own and the Toolbar dialog box, as well as response function, can refer to the above-mentioned methods.

Then, through the use of CATIA Modeling own or use the second to develop their own application code to generate the digital model of machine. In this paper, the latter, so that the back of the model in favor of the operation and to add binding parameters such as machine tool stroke. Modeling use of CATIA modules of the product mix, machine tools document *. CATProduct. First of all, the application of the CAA C + + part of the establishment of Part Design the various parts of machine parts, each part into a separate file *. CATPart. And then the application of CAA C + + for 3D PLM PPR components throughout the assembly machine.

Machine followed by the realization of the motion simulation. NC read documents processed to extract the direction and coordinates the movement of value. CATIDocRoots application interface model to find the root of machine products (Root Product), traverse has been to move the corresponding machine tool components, the corresponding interface CATIMovable be part of the mobile, mobile CATMathTransformation type of matrix.

Finally, tool path generation and display, where the GSM used in the CAA and Shape Design & Styling. Can show a straight line, arc, and spline curves.

CATIA's interface based on the secondary development of methods and examples

Figure 9 the overall machine tool motion simulation effects Figure

CATIA's interface based on the secondary development of methods and examples

Figure 10, 11 local sports simulation results shown in Fig independent guides

Machine tool motion simulation to explore the application of CAA to achieve the second development interface, physical and space curve modeling, the effect of product assembly and movement and so on. Can be achieved not only a virtual machining simulation and virtual assembly can be applied to the animation display. CATIA CAA because the secondary development of the use of COM components and the application of methods, combined with CATIA itself hierarchical structure and rigorous, and therefore compared to other CAD software is also more difficult.

V. Conclusion

CAA applications CATIA software components on the secondary development of dedicated system can be greatly shortened the development cycle. Component Application Architecture (CAA) Component Application Architecture is the integration of third-party products to customers and the general customers, the personality of the powerful design tools, the use of CAA can be applied to achieve Dassault Systemes to develop the deep-seated. However, Dassault Systemes as a result of the complexity of the application itself and the CAA involved in-depth content, combined with CATIA itself hierarchical structure and rigorous, so the use of CAA for CATIA secondary development when compared with other CAD software also have greater the complexity and difficulty, but at the same time can achieve greater functionality.

AutoCAD Tutorial Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.