Air cylinder opening state rapid generation method based on Catia secondary development
Through the secondary development method based on Catia, the cylinder opening state is quickly generated, which solves the problem of cumbersome and prone to position errors in the prior art, and achieves efficient and accurate cylinder opening state generation.
Patent Information
- Application Number
- CN202411715739.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-28
AI Technical Summary
The process of generating the open state of the cylinder under the prior art is cumbersome, time-consuming and labor-intensive, and it is easy to cause the rotation axis to overlap inaccurately due to visual errors, resulting in the wrong position of the open state of the cylinder.
The rapid generation method of cylinder opening status based on Catia secondary development is adopted. By initializing the object, importing cylinder parameter information, selecting the rotation axis and cylinder parts, inputting the rotation angle and applying the function to generate the status, if necessary, correcting the rotation direction error by checking the "Reverse" option.
The efficiency of generating the cylinder opening state is significantly improved, visual illusion errors in manual operation are avoided, and overall design quality is improved.
Smart Images

Figure CN119720407A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of tooling design methods, and in particular to a method for quickly generating a cylinder opening state based on Catia secondary development. Background Art
[0002] Currently, the 3D design software CATIA has been widely used in tooling design of automotive equipment integrators and surface design of automobiles and aircraft. In the process of automobile production, it is often necessary to simulate the open state of the cylinder when designing parts. However, the process of generating the open state of the cylinder under the existing technology is quite cumbersome: it requires users to manually create new instances of the "OPEN" component node and all cylinder parts under it, and manually set the coincidence of the compass with the cylinder rotation axis, and adjust the rotation parameters to achieve the open state of the cylinder. In addition, users need to manually modify the color and transparency of the "OPEN" node to enhance the visualization effect. This series of steps is not only time-consuming and laborious, but also when dragging the compass to align with the rotation axis, a slight mistake may cause inaccurate coincidence due to visual errors, thereby causing position errors in the open state of the cylinder. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art. To achieve the above purpose, a method for quickly generating the cylinder opening state based on Catia secondary development is adopted to solve the problems raised in the above background technology.
[0004] A method for quickly generating a cylinder opening state based on Catia secondary development includes the following steps:
[0005] Step S1, initializing the object based on the cylinder opening state component tool of Catia, and calling the initialization parameter window;
[0006] Step S2, in the parameter window, import the parameter information of the cylinder, select the rotation axis of the cylinder in turn, select the cylinder part to be generated in the open state, and input the rotation angle;
[0007] Step S3, click the "Apply" button on the parameter window and execute the function to generate the open state of the cylinder;
[0008] Step S4: If it is found that the generated cylinder opening state has an incorrect rotation direction, regenerate the cylinder opening state by checking the "Reverse" option and then clicking the "Apply" button again;
[0009] Step S5: After completing the rapid generation of the cylinder opening state, close the cylinder opening state component tool.
[0010] As a further solution of the present invention: the specific steps in step S1 include:
[0011] Start a Catia-based program, create a dialog box, get the application focus, and initialize objects;
[0012] Add callback functions for the application, cancel, and close operations of the window. If a cancel or close operation notification is received, the program ends. If an application operation notification is received, the OKAction() function is executed.
[0013] Generate the first path element proxy and set the proxy type to "CATLine" and "CATIGSMLine";
[0014] Generate the second path element proxy, set the proxy type to "CATIProduct", and add a filter to the element proxy to only allow parts to be selected;
[0015] Finally activate the first path element proxy.
[0016] As a further solution of the present invention: the specific steps of selecting the rotating axis of the cylinder in step S2 include:
[0017] In the parameter window, when the first path element agent is in an activated state, if the user selects a straight line path, the detailed path information of the straight line will be displayed in the program interface;
[0018] Thereafter, the system will perform a deactivation operation on the first path element proxy, and subsequently trigger the activation state of the second path element proxy.
[0019] As a further solution of the present invention: the specific steps of selecting the cylinder parts to be generated in the open state in step S2 include:
[0020] Under the condition that the second path element agent is in an activated state, when the user performs a part selection operation, the part number of the selected part will be appended to the cylinder part list preset in the interface window and the operation will be repeated;
[0021] Furthermore, when the user selects any list item in the cylinder parts list and triggers the operation by right-clicking the mouse, a context menu including the functions of "clear selected items" and "clear all items" will be presented;
[0022] When the user clicks the "Clear Selected Items" command, the system will remove the currently selected list item; and clicking the "Clear All Items" command will cause all items in the cylinder parts list to be cleared.
[0023] As a further solution of the present invention: the specific steps of inputting the rotation angle in step S2 include:
[0024] In the parameter window, enter the rotation angle value when the cylinder assembly is in the open state;
[0025] If the user chooses to activate the "Reverse" flag, the system will multiply the previously entered rotation angle value by "-1" to achieve reverse rotation when generating the open state configuration.
[0026] As a further solution of the present invention: the specific steps in step S4 include:
[0027] Get the root node of the current 3D assembly document;
[0028] Get the "OPEN" node under the root node. If the "OPEN" node exists, clear the open state instance of the currently selected cylinder part under the "OPEN" node; if the "OPEN" node does not exist, create an "OPEN" component node under the root node.
[0029] Convert the rotation axis selected by the user into the corresponding straight line object spMathLine;
[0030] Convert the angle value entered by the user into a radian value. If the user selects the "Reverse" option, the radian value is multiplied by "-1";
[0031] Traverse the cylinder parts selected by the user and perform operations on each part;
[0032] Set the color and transparency for the "OPEN" node;
[0033] If the generated cylinder open state is found to rotate in the wrong direction, the user checks / unchecks the "Reverse" option and clicks the "Apply" button again.
[0034] As a further solution of the present invention: the specific steps of traversing the cylinder parts selected by the user and performing the operation on each part include:
[0035] Create a new instance of the cylinder part under the "OPEN" node;
[0036] Get the transformation spTransformation from the coordinate system of the rotating axis part to the coordinate system of the cylinder part;
[0037] Get the rotation axis line spAxisLine in the cylinder part coordinate system. The formula is:
[0038] spAxisLine=spMathLine*spTransformation;
[0039] Create a rotation transformation matrix spRotateTrans according to the rotation axis and rotation angle;
[0040] Get the global coordinates spAbsPosition of the cylinder part;
[0041] Calculate the global coordinates of the cylinder part after rotation transformation, spNewAbsPosition, the formula is:
[0042] spNewAbsPosition=spAbsPosition*spRotateTrans;
[0043] Set the cylinder part to the new global coordinate spNewAbsPosition.
[0044] Compared with the prior art, the present invention has the following technical effects:
[0045] The above technical solution is adopted to realize the rapid generation of cylinder open state through Catia cylinder open state component tool. The specific steps include initializing objects, importing cylinder parameter information, selecting rotation axis and cylinder parts, inputting rotation angle, applying function to generate state, and correcting rotation direction error by checking the "reverse" option when necessary. This solution significantly improves the efficiency of generating cylinder open state, while effectively avoiding visual illusion errors in manual operation, thereby improving the overall design quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings:
[0047] Figure 1 A schematic diagram of the steps of the rapid generation method of the embodiment disclosed in this application;
[0048] Figure 2 A flowchart of a rapid generation method according to an embodiment disclosed in the present application;
[0049] Figure 3 A schematic diagram of a parameter window of a rapid generation method according to an embodiment disclosed in the present application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] Please refer to Figure 1 and Figure 2 In an embodiment of the present invention, a method for quickly generating a cylinder opening state based on Catia secondary development includes the following steps:
[0052] Step S1: Initialize the object based on the cylinder opening state component tool of Catia and call the initialized parameter window. The specific steps include:
[0053] Start a Catia-based program, create a dialog box, get the application focus, and initialize objects;
[0054] Add callback functions for the application, cancel, and close operations of the window. If a cancel or close operation notification is received, the program ends. If an application operation notification is received, the OKAction() function is executed.
[0055] Generate the first path element proxy and set the proxy type to "CATLine" and "CATIGSMLine";
[0056] Generate the second path element proxy, set the proxy type to "CATIProduct", and add a filter to the element proxy to only allow parts to be selected;
[0057] Finally activate the first path element proxy.
[0058] Step S2, in the parameter window, import the parameter information of the cylinder, select the rotation axis of the cylinder in turn, select the cylinder part to be generated in the open state, and input the rotation angle;
[0059] Step S21: The specific steps of selecting the rotation axis of the cylinder in step S2 of the specific embodiment include:
[0060] like Figure 3 As shown, the figure is a schematic diagram of the parameter window of the rapid generation method;
[0061] In the parameter window, when the first path element agent is in an activated state, if the user selects a straight line path, the detailed path information of the straight line will be displayed in the program interface;
[0062] Thereafter, the system will perform a deactivation operation on the first path element proxy, and subsequently trigger the activation state of the second path element proxy.
[0063] Step S22, the specific steps of selecting the cylinder part to be generated in the open state include:
[0064] Under the condition that the second path element agent is in an activated state, when the user performs a part selection operation, the part number of the selected part will be appended to the cylinder part list preset in the interface window and the operation will be repeated;
[0065] Furthermore, when the user selects any list item in the cylinder parts list and triggers the operation by right-clicking the mouse, a context menu including the functions of "clear selected items" and "clear all items" will be presented;
[0066] When the user clicks the "Clear Selected Items" command, the system will remove the currently selected list item; and clicking the "Clear All Items" command will cause all items in the cylinder parts list to be cleared.
[0067] Step S23, the specific steps of inputting the rotation angle include:
[0068] In the parameter window, enter the rotation angle value when the cylinder assembly is in the open state;
[0069] If the user chooses to activate the "Reverse" flag, the system will multiply the previously entered rotation angle value by "-1" to achieve reverse rotation when generating the open state configuration.
[0070] Step S3, click the "Apply" button on the parameter window and execute the function to generate the open state of the cylinder;
[0071] Step S4: If it is found that the generated cylinder opening state has an incorrect rotation direction, the cylinder opening state is regenerated by checking the "Reverse" option and then clicking the "Apply" button again. The specific steps include:
[0072] Step S41, obtaining the root node of the current 3D assembly document;
[0073] Step S42, obtaining an "OPEN" node under the root node, and if the "OPEN" node exists, clearing the open state instance of the currently selected cylinder part under the "OPEN" node; if the "OPEN" node does not exist, creating an "OPEN" component node under the root node;
[0074] Step S43, converting the rotation axis selected by the user into a corresponding straight line object spMathLine;
[0075] Step S44, convert the angle value input by the user into a radian value. If the user checks the "reverse" option, the radian value is multiplied by "-1";
[0076] Step S45, traverse the cylinder parts selected by the user, and perform operations on each part. The specific steps include:
[0077] Step S451, creating a new instance of the cylinder part under the "OPEN" node;
[0078] Step S452, obtaining the transformation spTransformation from the coordinate system of the rotating shaft part to the coordinate system of the cylinder part;
[0079] Step S453, obtain the rotation axis line spAxisLine in the cylinder part coordinate system, the formula is:
[0080] spAxisLine=spMathLine*spTransformation;
[0081] Step S454, creating a rotation transformation matrix spRotateTrans according to the rotation axis and the rotation angle;
[0082] Step S455, obtaining the global coordinates spAbsPosition of the cylinder part;
[0083] Step S456, calculate the global coordinates of the cylinder part after rotation transformation, spNewAbsPosition, the formula is:
[0084] spNewAbsPosition=spAbsPosition*spRotateTrans;
[0085] Step S457, set the cylinder part to the new global coordinate spNewAbsPosition.
[0086] Step S46, setting the color and transparency for the "OPEN" node;
[0087] (1) Get the graphic attribute interface of the "OPEN" component;
[0088] (2) Create a graphics attribute object, set the color value of the object to RGB (255, 0, 255), and set the transparency of the object to 191;
[0089] (3) Set the color and transparency of the "OPEN" component to the value of the above graphic attribute object;
[0090] (4) Set the child nodes of the "OPEN" component to inherit its graphic attributes;
[0091] (5) Send "OPEN" component color attribute modification notification and refresh the CATIA window display;
[0092] Step S47: If it is found that the generated cylinder opening state rotation direction is wrong, the user checks / unchecks the "Reverse" option and then clicks the "Apply" button again.
[0093] Step S5: After completing the rapid generation of the cylinder opening state, close the cylinder opening state component tool.
[0094] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents, and all should be included within the scope of protection of the present invention.
Claims
1. A method for quickly generating cylinder opening status based on Catia secondary development, characterized in that: The following steps are involved: Step S1, initializing the object based on the cylinder opening state component tool of Catia, and calling the initialization parameter window; Step S2, in the parameter window, import the parameter information of the cylinder, select the rotation axis of the cylinder in turn, select the cylinder part to be generated in the open state, and input the rotation angle; Step S3, click the "Apply" button on the parameter window and execute the function to generate the open state of the cylinder; Step S4: If it is found that the generated cylinder opening state has an incorrect rotation direction, regenerate the cylinder opening state by checking the "Reverse" option and then clicking the "Apply" button again; Step S5: After completing the rapid generation of the cylinder opening state, close the cylinder opening state component tool.
2. According to claim 1, a method for quickly generating the cylinder opening state based on Catia secondary development is characterized in that: The specific steps in step S1 include: Start a Catia-based program, create a dialog box, get the application focus, and initialize objects; Add callback functions for the application, cancel, and close operations of the window. If a cancel or close operation notification is received, the program ends. If an application operation notification is received, the OKAction() function is executed. Generate the first path element proxy and set the proxy type to "CATLine" and "CATIGSMLine"; Generate the second path element proxy, set the proxy type to "CATIProduct", and add a filter to the element proxy to only allow parts to be selected; Finally activate the first path element proxy.
3. According to claim 2, a method for quickly generating cylinder opening status based on Catia secondary development is characterized in that: The specific steps of selecting the rotation axis of the cylinder in step S2 include: In the parameter window, when the first path element agent is in an activated state, if the user selects a straight line path, the detailed path information of the straight line will be displayed in the program interface; Thereafter, the system will perform a deactivation operation on the first path element agent, and subsequently trigger the activation state of the second path element agent.
4. According to claim 3, a method for quickly generating cylinder opening status based on Catia secondary development is characterized in that: The specific steps of selecting the cylinder parts to be generated in the open state in step S2 include: Under the condition that the second path element agent is in an activated state, when the user performs a part selection operation, the part number of the selected part will be appended to the cylinder part list preset in the interface window and the operation will be repeated; Furthermore, when the user selects any list item in the cylinder parts list and triggers the operation by right-clicking the mouse, a context menu containing the functions of "clear selected items" and "clear all items" will be presented; When the user clicks the "Clear Selected" command, the system will remove the currently selected list item; and clicking the "Clear All" command will cause all items in the cylinder parts list to be cleared.
5. According to claim 4, a method for quickly generating cylinder opening status based on Catia secondary development is characterized in that: The specific steps of inputting the rotation angle in step S2 include: In the parameter window, enter the rotation angle value when the cylinder assembly is in the open state; If the user chooses to activate the "Reverse" flag, the system will multiply the previously entered rotation angle value by "-1" to achieve reverse rotation when generating the open state configuration.
6. According to claim 1, a method for quickly generating cylinder opening status based on Catia secondary development is characterized in that: The specific steps in step S4 include: Get the root node of the current 3D assembly document; Get the "OPEN" node under the root node. If the "OPEN" node exists, clear the open state instance of the currently selected cylinder part under the "OPEN" node; if the "OPEN" node does not exist, create an "OPEN" component node under the root node. Convert the rotation axis selected by the user into the corresponding straight line object spMathLine; Convert the angle value entered by the user into a radian value. If the user selects the "Reverse" option, the radian value is multiplied by "-1"; Traverse the cylinder parts selected by the user and perform operations on each part; Set the color and transparency for the "OPEN" node; If the generated cylinder opening state is found to rotate in the wrong direction, the user can check / uncheck the "Reverse" option and click the "Apply" button again.
7. According to claim 6, a method for quickly generating cylinder opening status based on Catia secondary development is characterized in that: The specific steps of traversing the cylinder parts selected by the user and performing the operation on each part include: Create a new instance of the cylinder part under the "OPEN" node; Get the transformation spTransformation from the coordinate system of the rotating axis part to the coordinate system of the cylinder part; Get the rotation axis line spAxisLine in the cylinder part coordinate system. The formula is: spAxisLine=spMathLine*spTransformation; Create a rotation transformation matrix spRotateTrans according to the rotation axis and rotation angle; Get the global coordinates spAbsPosition of the cylinder part; Calculate the global coordinates of the cylinder part after rotation transformation, spNewAbsPosition, the formula is: spNewAbsPosition=spAbsPosition*spRotateTrans; Set the cylinder part to the new global coordinate spNewAbsPosition.