CATIA VBA-based secondary development aileron mechanism parametric modeling method
By using CATIA VBA secondary development, a parametric modeling method for the aileron mechanism was established, which solved the problems of low efficiency and error susceptibility in the existing technology, realized automated modeling and model consistency, and improved design efficiency and accuracy.
Patent Information
- Application Number
- CN202511759807.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-02-06
AI Technical Summary
Existing CATIA modeling methods are inefficient, error-prone, and difficult to achieve efficient and accurate design of aileron mechanisms. They are particularly bottlenecked in parameter adjustment and optimization design, and lack in-depth adaptation to aviation airworthiness requirements.
Based on CATIA VBA secondary development, by acquiring geometric dimension data, establishing part-level parametric templates, building an assembly relationship logic framework, constructing an integrated parametric model, and developing a main control program and interactive interface, automatic updates and reconstruction are achieved.
The automated modeling of the aileron mechanism was achieved, reducing repetitive operations, improving modification efficiency and accuracy, ensuring model consistency and standardization, reducing error risk, and meeting actual needs.
Smart Images

Figure CN121479936A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of aircraft aileron mechanism modeling technology, specifically involving a parametric modeling method for aileron mechanisms based on CATIA VBA secondary development. Background Technology
[0002] In aircraft design, the aileron mechanism, as a key flight control surface transmission system on the outer trailing edge of the main wing, plays a crucial role in translating control commands into precise differential deflections to control the aircraft's roll motion. This mechanism typically consists of rocker arms, linkages, control shafts, and actuators, and its geometry, kinematic performance, and dynamic characteristics directly determine the aircraft's maneuverability, safety, and reliability. Currently, the industry widely uses general-purpose CAD software such as CATIA for design, with processes encompassing manual geometric modeling, constraint-based assembly, manual kinematic simulation, and iterative verification.
[0003] However, existing modeling methods face significant challenges: any adjustment to design parameters (such as hinge point position, actuator stroke, or airfoil spatial changes) requires engineers to backtrack and modify multiple part features and assembly constraints, followed by resetting kinematic simulations and verifying the results. This process is not only inefficient and has a lengthy iteration cycle, but manual operation is also prone to introducing errors, making it difficult to guarantee model consistency and reliability. Furthermore, CATIA's native parametric capabilities struggle to support the global linkage of complex aileron mechanisms. Design knowledge (such as transmission angle optimization rules and interference avoidance logic) cannot be effectively embedded into the model. Parameter sensitivity analysis and optimization design are difficult to implement due to the cumbersome process. A large amount of repetitive work, such as manually modeling similar components in the aileron mechanism (such as multiple control surfaces and fuselage), requires frequent model adjustments for aerodynamic and structural analyses. Manual reconstruction is time-consuming and inefficient, and manual operation is prone to errors during multi-scheme comparisons or team collaborations. Model modification is cumbersome, and later adjustments to component positions and dimensions can have far-reaching consequences, leading to difficulties or even impossibilities in modification, severely restricting design quality and work efficiency.
[0004] While existing technologies attempt to alleviate these problems through CATIA's native Knowledge Engineering (KBE) module or general parametric plugins, they still have fundamental shortcomings in the specific scenario of aerospace aileron mechanisms. Although the CATIA API provides low-level control capabilities, building globally driven parametric models requires extremely high levels of secondary development skills, and interactive operations struggle to achieve intelligent linkage between mechanism topology, geometry, and kinematics. General plugins lack deep adaptation to professional requirements such as airworthiness requirements, failure modes, and system interfaces. Specialized dynamics software (such as ADAMS), while adept at mechanism simulation, faces integration barriers with the aircraft master model (usually based on CATIA) and has weak geometric parametric capabilities. These limitations result in efficiency bottlenecks, error risks, knowledge gaps, and optimization difficulties in existing parametric modeling, which have not been systematically resolved. Therefore, the aerospace field urgently needs a method that deeply integrates parametricization, automation, and domain knowledge to achieve efficient and accurate design of aileron mechanisms. Summary of the Invention
[0005] The purpose of this invention is to provide a parametric modeling method for aileron mechanisms based on CATIA VBA secondary development, which solves the problems of low efficiency and high error risk in existing parametric modeling.
[0006] The technical solution adopted in this invention is a parametric modeling method for aileron mechanisms based on CATIA VBA secondary development, which specifically includes the following steps: Step 1: Based on the existing three-dimensional assembly model of the aileron mechanism, obtain the geometric dimension data of each component to form an initial design parameter database; Step 2: Create a part-level parametric template; Step 3: Build the logical framework for assembly relationships; Step 4: Construct an integrated and internally interconnected parametric model; Step 5: Develop the main control program and interactive interface. By modifying the interface parameters, drive the entire aileron mechanism model to automatically update and rebuild.
[0007] The invention is further characterized in that, Step 1 involves using either engineering drawing export or direct model measurement to obtain the key geometric dimensions of all components in the existing three-dimensional assembly model of the aileron mechanism. The extracted data is then categorized and organized to construct an initial design parameter database.
[0008] Key geometric dimensions include key positioning dimensions, contour dimensions, and structural dimensions.
[0009] Step 2 is as follows: Step 2.1: Initialize the macro recording environment. In the CATIA software environment, call the macro function module, create a user macro library, specify the storage path, create parameterized macro files, and create form modules and part modules respectively, thereby laying the foundation for subsequent structured and procedural parametric modeling. Step 2.2: In the parts module constructed in Step 2.1, the modeling process of the parts is recorded in a programmed manner. The macro recording function is started, and the modeling process of multiple key parts of the aileron mechanism is recorded in a programmed manner in sequence. The key parts include servo mount, servo, actuator, rocker arm pin, rocker arm, rudder shaft, rocker arm mount, rudder surface and bearing mount. Step 2.3: After recording is completed, the CATIA software automatically generates and stores the corresponding CATProduct assembly file, CATPart part file, and VBA macro code file that records the modeling process to ensure the repeatability of the modeling process and the adjustability of key dimensional parameters. Step 2.4: After recording is complete, manually supplement and edit the original VBA code and correct its properties.
[0010] The corrected method is to locate the code module corresponding to the target part in the VBA development environment, and then call the corresponding properties and methods of the part document object to achieve precise setting of the identification information.
[0011] Step 3 specifically involves; Step 3.1: In the CATIA assembly design module, start the macro recording function of CATIA, create a new assembly Product file based on the overall assembly relationship of the existing three-dimensional assembly model of the aileron mechanism, and import the Part files of each part generated and stored in step 2.3 in sequence. The part files for each component include the servo mount, servo, actuator stick, rocker arm pin, rocker arm, rudder shaft, rocker arm mount, rudder surface, and bearing mount; Step 3.2: Based on the functional principle and structural requirements of the aileron mechanism, apply assembly constraints to determine the spatial orientation relationship between the parts and reproduce the complete aileron mechanism assembly.
[0012] Assembly constraints are applied through programmed operations in a preset order, and the order and logic of constraint application are as follows: Step 3.2.1: Establish fixed constraints between the servo mount and the rocker arm, and determine their relative positions on the foundation; Step 3.2.2: Sequentially establish coaxial constraints between the servo mount and the servo, between the servo and the actuator stick, and between the actuator stick and the rocker arm and the rocker arm pin. Step 3.2.3: Establish coaxial constraints between the rocker arm, rocker arm seat, rudder shaft, rudder surface, and bearing seat; Step 3.2.4: Apply key distance dimension constraints and height direction position constraints to ensure that the entire assembly is fully constrained and that the degrees of freedom of movement meet the design requirements.
[0013] Step 4 specifically involves: Step 4.1: In the CATIA VBA editing interface, open the overall assembly macro code recorded in Step 3. In the assembly logic framework code generated in Step 3, locate the parts that are introduced to each part and locate the code module that calls the specific external part file. Step 4.2: Use the parametric modeling template code of the corresponding part generated in Step 2 as a subroutine or procedure call to replace the original part import instruction.
[0014] The code replacement operation involves replacing the code used to load external part files from a specified path with the VBA program code recorded in step 2.2, which is used to directly generate the actuator geometry model, using the AddComponentsFromFiles method. To ensure that the integrated code executes correctly, necessary pre-declarations and post-processing code are added before and after the direct drawing code during the replacement process to maintain the correct program running environment.
[0015] Step 5 is as follows: Step 5.1: Write the main control VBA code and define a set of core driving parameters that control the macroscopic shape and key structural dimensions of the aileron mechanism; In the CATIA VBA editing environment, create a custom user form UserForm and name the form module "UseForm1". Design the completed interface layout and place controls on the form for parameter input and command operation. Add three text label Label controls and define the displayed text as "Actuator Length", "Base Spacing", and "Rocker Arm Height" respectively. For each label, add a text box control to receive the specific parameter values entered by the user. Add two command button controls, labeled "Draw" and "Cancel" respectively, to perform the generation of the parametric model and the closing of the form; Step 5.2: Develop a graphical user interface and bind the core driver parameters to the input controls in the interface. Configure event-driven logic for the command buttons in the form. Double-click the "Draw" button to enter the VBA code editing page for the command button. Embed the VBA code that has been integrated and debugged in step 4 and can completely generate the aileron mechanism assembly into this event process. Change the original program's startup entry point Sub CATMain() to the execution command Private Sub CommandButton1_Click() corresponding to this event, thereby ensuring that this code responds to the user's "Draw" operation and executes. Similarly, write the code Me.Hide for the "Cancel" command button to realize the function of closing the form when clicked. Step 5.3 encapsulates the entire code system and interface, enabling the automatic updating and reconstruction of the entire aileron mechanism model by modifying interface parameters; In the event code of the "Draw" button, establish the driving link between user input parameters and internal model dimension variables; implement parametric compilation for the three key dimensions of actuator length, distance between the two bases, and rocker arm height; locate and identify the variables length9, length10, and length11 representing these three dimensions in the code, and replace them with the input values obtained from the corresponding text boxes on the form, namely TextBox1.Text, TextBox2.Text, and TextBox3.Text; after completing the code adjustment, perform overall compilation and runtime testing; when the macro is run, a parameter input interface will pop up. After the user enters valid parameter values and clicks the "Draw" button, the system will automatically generate a parametric assembly model of the aileron mechanism that conforms to the specified dimensions.
[0016] The beneficial effects of this invention are as follows: Based on the CATIA VBA secondary development parametric modeling method for aileron mechanisms, this invention achieves an automated modeling process. It automatically generates entity parts such as the fuselage, servo, actuator, and control surfaces, reducing repetitive operations. During compilation, parts that do not require size modification are encapsulated and called, avoiding memory usage in the main code. For parts requiring size modification, direct drawing is used, reducing the redundancy of the parametric code and ensuring the operability of the parametric process and the stability of the main assembly code. Modifying parameters (such as fuselage spacing and actuator length) automatically updates the entire model, improving modification efficiency and accuracy. It solidifies the modeling process, achieving standardized modeling, ensuring model consistency and standardization, reducing errors caused by information asymmetry, and making the model not only realistic but also meeting actual needs, thus improving its practicality. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the aileron mechanism assembly model based on SolidWorks modeling in this invention; Figure 2This is a flowchart of the method for setting the default directory during the CATIA macro recording stage according to the present invention; Figure 3 This is a schematic diagram of the user interface for creating a macro library during the CATIA macro recording stage of this invention. Figure 4 This is a schematic diagram illustrating the creation of a macro file storage directory during the CATIA macro recording stage of this invention; Figure 5 This is a schematic diagram of the parameterized user control panel created during the CATIA macro recording stage of this invention; Figure 6(a) is a schematic diagram of the servo mount part model drawn during the CATIA macro recording stage of this invention; Figure 6(b) is a schematic diagram of the rocker arm support part model drawn during the CATIA macro recording stage of this invention; Figure 6(c) is a schematic diagram of the servo motor part model drawn during the CATIA macro recording stage of this invention; Figure 6(d) is a schematic diagram of the servo actuator part model drawn during the CATIA macro recording stage of this invention; Figure 6(e) is a schematic diagram of the rocker arm part model drawn during the CATIA macro recording stage of this invention; Figure 6(f) is a schematic diagram of the bearing housing part model drawn during the CATIA macro recording stage of this invention; Figure 6(g) is a schematic diagram of the rudder surface part model drawn during the CATIA macro recording stage of this invention; Figure 7 This is a schematic diagram of the overall assembly model drawn during the CATIA macro recording stage of this invention.
[0018] In the diagram, 1. Servo mount, 2. Servo, 3. Actuator stick, 4. Rocker arm pin, 5. Rocker arm, 6. Rudder shaft, 7. Rocker arm mount, 8. Rudder surface, 9. Bearing housing. Detailed Implementation
[0019] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0020] Example 1 This invention is based on a parametric modeling method for aileron mechanisms developed using CATIA VBA secondary development, and is implemented according to the following steps: Step 1: Based on the existing three-dimensional assembly model of the aileron mechanism, obtain the geometric dimension data of each component to form an initial design parameter database; Step 2: Create a part-level parametric template; Step 3: Build the logical framework for assembly relationships; Step 4: Construct an integrated and internally interconnected parametric model; Step 5: Develop the main control program and interactive interface. By modifying the interface parameters, drive the entire aileron mechanism model to automatically update and rebuild.
[0021] Example 2 This invention is based on a parametric modeling method for aileron mechanisms developed using CATIA VBA secondary development, and is implemented according to the following steps: Step 1: Based on the existing three-dimensional assembly model of the aileron mechanism, obtain the geometric dimension data of each component to form an initial design parameter database; Step 1 specifically involves obtaining a 3D assembly model of the existing aileron mechanism using either the engineering drawing export method or the direct model measurement method, such as... Figure 1 As shown, the key geometric dimensions of all component parts are extracted, categorized, and organized to form an initial design parameter database, providing a data source for subsequent parametric modeling.
[0022] The direct measurement method uses SolidWorks software and calls SolidWorks' built-in measurement tools to measure and systematically record the key geometric dimensions of each part in the aileron mechanism model. In this way, all the initial data required to build the parametric model can be obtained efficiently and accurately.
[0023] Key geometric dimensions include key positioning dimensions, contour dimensions, and structural dimensions.
[0024] Step 2: Create a part-level parametric template; Step 3: Build the logical framework for assembly relationships; Step 4: Construct an integrated and internally interconnected parametric model; Step 5: Develop the main control program and interactive interface. By modifying the interface parameters, drive the entire aileron mechanism model to automatically update and rebuild.
[0025] Example 3 This invention is based on a parametric modeling method for aileron mechanisms developed using CATIA VBA secondary development, and is implemented according to the following steps: Step 1: Based on the existing three-dimensional assembly model of the aileron mechanism, obtain the geometric dimension data of each component to form an initial design parameter database; Step 1 involves using either engineering drawing export or direct model measurement to obtain the key geometric dimensions of all components in the existing three-dimensional assembly model of the aileron mechanism. The extracted data is then categorized and organized to form an initial design parameter database, providing a data source for subsequent parametric modeling.
[0026] The direct measurement method uses SolidWorks software and calls SolidWorks' built-in measurement tools to measure and systematically record the key geometric dimensions of each part in the aileron mechanism model. In this way, all the initial data required to build the parametric model can be obtained efficiently and accurately.
[0027] Key geometric dimensions include key positioning dimensions, contour dimensions, and structural dimensions.
[0028] Step 2: Create a part-level parametric template; Step 2 is as follows: like Figure 2 , Figure 3 , Figure 4 As shown, in step 2.1, the macro recording environment is initialized. In the CATIA software environment, the macro function module is called, a user macro library is created, the storage path is specified, and a parameterized macro file is created. The form module and part module are created respectively, thus laying the foundation for subsequent structured and procedural parameter modeling. Step 2.2: In the part module constructed in step 2.1, the modeling process of the part is recorded in a programmed manner. The macro recording function is started, and the modeling process of multiple key parts of the aileron mechanism is recorded in a programmed manner in sequence. Key components include servo mount 1, servo 2, actuator 3, rocker arm pin 4, rocker arm 5, rudder shaft 6, rocker arm mount 7, rudder surface 8, and bearing mount 9.
[0029] Step 2.3: After recording is completed, the CATIA software automatically generates and stores the corresponding CATProduct assembly file, CATPart part file, and VBA macro code file that records the modeling process to ensure the repeatability of the modeling process and the adjustability of key dimensional parameters.
[0030] Step 2.4: After recording is complete, manually supplement and edit the original VBA code and correct its properties.
[0031] The specific correction method is to locate the code module corresponding to the target part in the VBA development environment, and then call the corresponding properties and methods of the part document object to achieve precise setting of the identification information.
[0032] Taking the actuator rod part as an example, after retrieving the code statement to open the part document, a code segment is added to set its part code and name attributes, thereby achieving clear and accurate identification in the assembly tree. The identification information of other parts is uniformly corrected in the same way.
[0033] Step 3: Build the logical framework for assembly relationships; Step 4: Construct an integrated and internally interconnected parametric model; Step 5: Develop the main control program and interactive interface. By modifying the interface parameters, drive the entire aileron mechanism model to automatically update and rebuild.
[0034] Example 4 This invention is based on a parametric modeling method for aileron mechanisms developed using CATIA VBA secondary development, and is implemented according to the following steps: Step 1: Based on the existing three-dimensional assembly model of the aileron mechanism, obtain the geometric dimension data of each component to form an initial design parameter database; Step 1 involves using either engineering drawing export or direct model measurement to obtain the key geometric dimensions of all components in the existing three-dimensional assembly model of the aileron mechanism. The extracted data is then categorized and organized to form an initial design parameter database, providing a data source for subsequent parametric modeling.
[0035] The direct measurement method uses SolidWorks software and calls SolidWorks' built-in measurement tools to measure and systematically record the key geometric dimensions of each part in the aileron mechanism model. In this way, all the initial data required to build the parametric model can be obtained efficiently and accurately.
[0036] Key geometric dimensions include key positioning dimensions, contour dimensions, and structural dimensions.
[0037] Step 2: Create a part-level parametric template; Step 2 is as follows: Step 2.1: Initialize the macro recording environment. In the CATIA software environment, call the macro function module, create a user macro library, specify the storage path, create parameterized macro files, and create form modules and part modules respectively, thereby laying the foundation for subsequent structured and procedural parametric modeling. Step 2.2: In the part module constructed in step 2.1, the modeling process of the part is recorded in a programmed manner. The macro recording function is started, and the modeling process of multiple key parts of the aileron mechanism is recorded in a programmed manner in sequence. As shown in Figures 6(a)-6(g), the key components include servo mount 1, servo 2, actuator 3, rocker arm pin 4, rocker arm 5, rudder shaft 6, rocker arm mount 7, rudder surface 8, and bearing mount 9.
[0038] Step 2.3: After recording is completed, the CATIA software automatically generates and stores the corresponding CATProduct assembly file, CATPart part file, and VBA macro code file that records the modeling process to ensure the repeatability of the modeling process and the adjustability of key dimensional parameters.
[0039] Step 2.4: After recording is complete, manually supplement and edit the original VBA code and correct its properties.
[0040] The specific correction method is to locate the code module corresponding to the target part in the VBA development environment, and then call the corresponding properties and methods of the part document object to achieve precise setting of the identification information.
[0041] Taking the actuator rod part as an example, after retrieving the code statement to open the part document, a code segment is added to set its part code and name attributes, thereby achieving clear and accurate identification in the assembly tree. The identification information of other parts is uniformly corrected in the same way.
[0042] Step 3: Build the logical framework for assembly relationships; Step 3.1: In the CATIA assembly design module, start the macro recording function of CATIA, and according to the overall assembly relationship of the existing three-dimensional assembly model of the aileron mechanism, create a new assembly (Product) file, and import the part (Part) files generated and stored in step 2.3 in sequence. The part documents include servo mount 1, servo 2, actuator stick 3, rocker arm pin 4, rocker arm 5, rudder shaft 6, rocker arm mount 7, rudder surface 8, and bearing mount 9.
[0043] Step 3.2: Based on the functional principle and structural requirements of the aileron mechanism, apply assembly constraints to determine the spatial orientation relationship between the parts and reproduce the complete aileron mechanism assembly.
[0044] Step 4: Construct an integrated and internally interconnected parametric model; Step 5: Develop the main control program and interactive interface. By modifying the interface parameters, drive the entire aileron mechanism model to automatically update and rebuild.
[0045] Example 5 This invention is based on a parametric modeling method for aileron mechanisms developed using CATIA VBA secondary development, and is implemented according to the following steps: Step 1: Based on the existing three-dimensional assembly model of the aileron mechanism, obtain the geometric dimension data of each component to form an initial design parameter database; Step 1 involves using either engineering drawing export or direct model measurement to obtain the key geometric dimensions of all components in the existing three-dimensional assembly model of the aileron mechanism. The extracted data is then categorized and organized to form an initial design parameter database, providing a data source for subsequent parametric modeling.
[0046] The direct measurement method uses SolidWorks software and calls SolidWorks' built-in measurement tools to measure and systematically record the key geometric dimensions of each part in the aileron mechanism model. In this way, all the initial data required to build the parametric model can be obtained efficiently and accurately.
[0047] Key geometric dimensions include key positioning dimensions, contour dimensions, and structural dimensions.
[0048] Step 2: Create a part-level parametric template; Step 2 is as follows: Step 2.1: Initialize the macro recording environment. In the CATIA software environment, call the macro function module, create a user macro library, specify the storage path, create parameterized macro files, and create form modules and part modules respectively, thereby laying the foundation for subsequent structured and procedural parametric modeling. Step 2.2: In the part module constructed in step 2.1, the modeling process of the part is recorded in a programmed manner. The macro recording function is started, and the modeling process of multiple key parts of the aileron mechanism is recorded in a programmed manner in sequence. Key components include servo mount 1, servo 2, actuator 3, rocker arm pin 4, rocker arm 5, rudder shaft 6, rocker arm mount 7, rudder surface 8, and bearing mount 9.
[0049] Step 2.3: After recording is completed, the CATIA software automatically generates and stores the corresponding CATProduct assembly file, CATPart part file, and VBA macro code file that records the modeling process to ensure the repeatability of the modeling process and the adjustability of key dimensional parameters.
[0050] Step 2.4: After recording is complete, manually supplement and edit the original VBA code and correct its properties.
[0051] The specific correction method is to locate the code module corresponding to the target part in the VBA development environment, and then call the corresponding properties and methods of the part document object to achieve precise setting of the identification information.
[0052] Taking the actuator rod part as an example, after retrieving the code statement to open the part document, a code segment is added to set its part code and name attributes, thereby achieving clear and accurate identification in the assembly tree. The identification information of other parts is uniformly corrected in the same way.
[0053] Step 3: Build the logical framework for assembly relationships; Step 3.1: In the CATIA assembly design module, start the macro recording function of CATIA, and according to the overall assembly relationship of the existing three-dimensional assembly model of the aileron mechanism, create a new assembly (Product) file, and import the part (Part) files generated and stored in step 2.3 in sequence. The part documents include servo mount 1, servo 2, actuator stick 3, rocker arm pin 4, rocker arm 5, rudder shaft 6, rocker arm mount 7, rudder surface 8, and bearing mount 9.
[0054] Step 3.2: Based on the functional principle and structural requirements of the aileron mechanism, apply assembly constraints to determine the spatial orientation relationship between the parts and reproduce the complete aileron mechanism assembly.
[0055] Assembly constraints are applied through programmed operations in a preset order. The order and logic of constraint application are as follows: Step 3.2.1: Establish fixed constraints between servo mount 1 and rocker arm mount 7, and determine their relative positions. Step 3.2.2: Sequentially establish coaxial constraints between servo mount 1 and servo 2, between servo 2 and actuator 3, and between actuator 3 and rocker arm 5 and rocker arm pin 4. Step 3.2.3: Establish coaxial constraints between rocker arm 5, rocker arm seat 7, rudder shaft 6, rudder surface 8, and bearing seat 9. Step 3.2.4: Apply key distance dimension constraints and height direction position constraints to ensure that the entire assembly is fully constrained and that the degrees of freedom of movement meet the design requirements.
[0056] Step 4: Construct an integrated and internally interconnected parametric model; Step 5: Develop the main control program and interactive interface. By modifying the interface parameters, drive the entire aileron mechanism model to automatically update and rebuild.
[0057] Example 6 This invention is based on a parametric modeling method for aileron mechanisms developed using CATIA VBA secondary development, and is implemented according to the following steps: Step 1: Based on the existing three-dimensional assembly model of the aileron mechanism, obtain the geometric dimension data of each component to form an initial design parameter database; Step 1 involves using either engineering drawing export or direct model measurement to obtain the key geometric dimensions of all components in the existing three-dimensional assembly model of the aileron mechanism. The extracted data is then categorized and organized to form an initial design parameter database, providing a data source for subsequent parametric modeling.
[0058] The direct measurement method uses SolidWorks software and calls SolidWorks' built-in measurement tools to measure and systematically record the key geometric dimensions of each part in the aileron mechanism model. In this way, all the initial data required to build the parametric model can be obtained efficiently and accurately.
[0059] Key geometric dimensions include key positioning dimensions, contour dimensions, and structural dimensions.
[0060] Step 2: Create a part-level parametric template; Step 2 is as follows: Step 2.1: Initialize the macro recording environment. In the CATIA software environment, call the macro function module, create a user macro library, specify the storage path, create parameterized macro files, and create form modules and part modules respectively, thereby laying the foundation for subsequent structured and procedural parametric modeling. Step 2.2: In the part module constructed in step 2.1, the modeling process of the part is recorded in a programmed manner. The macro recording function is started, and the modeling process of multiple key parts of the aileron mechanism is recorded in a programmed manner in sequence. Key components include servo mount 1, servo 2, actuator 3, rocker arm pin 4, rocker arm 5, rudder shaft 6, rocker arm mount 7, rudder surface 8, and bearing mount 9.
[0061] Step 2.3: After recording is completed, the CATIA software automatically generates and stores the corresponding CATProduct assembly file, CATPart part file, and VBA macro code file that records the modeling process to ensure the repeatability of the modeling process and the adjustability of key dimensional parameters.
[0062] Step 2.4: After recording is complete, manually supplement and edit the original VBA code and correct its properties.
[0063] The specific correction method is to locate the code module corresponding to the target part in the VBA development environment, and then call the corresponding properties and methods of the part document object to achieve precise setting of the identification information.
[0064] Taking the actuator rod part as an example, after retrieving the code statement to open the part document, a code segment is added to set its part code and name attributes, thereby achieving clear and accurate identification in the assembly tree. The identification information of other parts is uniformly corrected in the same way.
[0065] Step 3: Build the logical framework for assembly relationships; Step 3.1: In the CATIA assembly design module, start the macro recording function of CATIA, and according to the overall assembly relationship of the existing three-dimensional assembly model of the aileron mechanism, create a new assembly (Product) file, and import the part (Part) files generated and stored in step 2.3 in sequence. The part documents include servo mount 1, servo 2, actuator stick 3, rocker arm pin 4, rocker arm 5, rudder shaft 6, rocker arm mount 7, rudder surface 8, and bearing mount 9.
[0066] Step 3.2: Based on the functional principle and structural requirements of the aileron mechanism, apply assembly constraints to determine the spatial orientation relationship between the parts and reproduce the complete aileron mechanism assembly.
[0067] Assembly constraints are applied through programmed operations in a preset order. The order and logic of constraint application are as follows: Step 3.2.1: Establish fixed constraints between servo mount 1 and rocker arm mount 7, and determine their relative positions. Step 3.2.2: Sequentially establish coaxial constraints between servo mount 1 and servo 2, between servo 2 and actuator 3, and between actuator 3 and rocker arm 5 and rocker arm pin 4. Step 3.2.3: Establish coaxial constraints between rocker arm 5, rocker arm seat 7, rudder shaft 6, rudder surface 8, and bearing seat 9. Step 3.2.4: Apply key distance dimension constraints and height direction position constraints to ensure that the entire assembly is fully constrained and that the degrees of freedom of movement meet the design requirements.
[0068] Step 4: Construct an integrated and internally interconnected parametric model; Step 4 specifically involves: Step 4.1: In the CATIA VBA editing interface, open the overall assembly macro code recorded in Step 3. In the assembly logic framework code generated in Step 3, locate the parts that are introduced to each part and locate the code module that calls the specific external part file.
[0069] Taking the actuator rod component as an example, we found the original code segment that calls the external CATPart file.
[0070] Step 4.2: Use the parametric modeling template code of the corresponding part generated in Step 2 as a subroutine or procedure call to replace the original part import instruction; The code replacement operation involves replacing the code used to load external part files from a specified path with the VBA program code recorded in step 2.2, which is used to directly generate the actuator geometry model, using the AddComponentsFromFiles method. To ensure that the integrated code executes correctly, necessary pre-declarations and post-processing code are added before and after the direct drawing code during the replacement process to maintain the correct program running environment.
[0071] Step 5: Develop the main control program and interactive interface. By modifying the interface parameters, drive the entire aileron mechanism model to automatically update and rebuild.
[0072] Step 5 is as follows: Step 5.1: Write the main control VBA code and define a set of core driving parameters that control the macroscopic shape and key structural dimensions of the aileron mechanism; In the CATIA VBA editing environment, create a custom user form (UserForm) and name the form module "UseForm1". Design the completed interface layout and place controls on the form for parameter input and command operation. Add three text label controls and define the text to be "Actuator Length", "Base Spacing", and "Rocker Arm Height" respectively. For each label, add a text box control to receive the specific parameter values entered by the user.
[0073] In addition, add two command button controls and set their labels to "Draw" and "Cancel" respectively, which are used to perform the generation of the parametric model and the closing of the form.
[0074] Step 5.2: Develop a graphical user interface and bind the core driving parameters to the input controls (such as text boxes and drop-down lists) in the interface. Configure event-driven logic for the command buttons on the form. Double-click the "Draw" button to enter the VBA code editing page for the command button. Embed the VBA code that has been integrated and debugged in step 4 and can completely generate the aileron mechanism assembly into this event process. Change the original program's startup entry point (Sub CATMain()) to the execution command corresponding to this event (Private Sub CommandButton1_Click()) to ensure that this code responds to the user's "Draw" operation and executes. Similarly, write code (Me.Hide) for the "Cancel" command button to implement the function of closing the form when clicked.
[0075] Step 5.3 encapsulates the entire code system and interface, enabling the automatic updating and reconstruction of the entire aileron mechanism model by modifying interface parameters.
[0076] In the event code of the "Draw" button, a driving link is established between user input parameters and internal model dimension variables. This invention focuses on parametric compilation of three key dimensions: actuator length, distance between the two bases, and rocker arm height. Therefore, variables representing these three dimensions (such as length9, length10, and length11) are located and identified in the code, and replaced with input values obtained from the corresponding text boxes on the form (i.e., TextBox1.Text, TextBox2.Text, and TextBox3.Text). After completing the code adjustments, the entire code is compiled and tested. When the macro is run, a pop-up will appear as follows: Figure 5 As shown in the parameter input interface, after the user enters valid parameter values and clicks the "Draw" button, the system will automatically generate a parametric assembly model of the aileron mechanism that conforms to the specified dimensions, such as... Figure 7 As shown.
[0077] The working principle of the parametric modeling method for aileron mechanisms based on CATIA VBA secondary development in this invention is as follows: Step 2 involves starting the macro recording function in the CATIA environment for each type of part of the aileron mechanism, recording the entire modeling process from sketch drawing to feature formation, and then encapsulating and storing the recording. Since the macro recording function has inherent limitations for some operations (such as feature deletion and undo, color modification, constraint adjustment, and object naming), the original VBA code needs to be manually supplemented and edited after recording. The original VBA code generated by the recording is then edited and organized again, and the fixed-value dimensional parameters are variableized to generate an independent parametric modeling template for the part that can be driven by the program.
[0078] Step 3: Start the macro recording function and add all parts step by step according to the original design intent and apply the correct assembly constraints to reproduce the complete aileron mechanism assembly. This process will generate VBA code that records the order of introduction of all components and the relationship of assembly constraints, which will serve as the assembly logic framework of the entire parametric model.
[0079] Step 4 constructs a highly integrated and internally interconnected parametric model system, where the geometric generation of parts and the overall assembly layout are both controlled by unified program logic. This integrated approach transforms the previous assembly mode, which relied on external file references, into a mode where geometry generation is directly driven by the program itself. This method not only significantly reduces the redundancy of the main assembly code and its dependence on external files, but also ensures the controllability of the parametric-driven process and the reliability of the entire system operation through the internal rendering of key parts.
Claims
1. A parametric modeling method for aileron mechanisms based on CATIA VBA secondary development, characterized in that, Specifically, the following steps are included: Step 1: Based on the existing three-dimensional assembly model of the aileron mechanism, obtain the geometric dimension data of each component to form an initial design parameter database; Step 2: Create a part-level parametric template; Step 3: Build the logical framework for assembly relationships; Step 4: Construct an integrated and internally interconnected parametric model; Step 5: Develop the main control program and interactive interface. By modifying the interface parameters, drive the entire aileron mechanism model to automatically update and rebuild.
2. The parametric modeling method for aileron mechanisms based on CATIA VBA secondary development according to claim 1, characterized in that, Step 1 involves using either engineering drawing export or direct model measurement to obtain the key geometric dimensions of all components in the existing three-dimensional assembly model of the aileron mechanism. The extracted data is then categorized and organized to construct an initial design parameter database.
3. The parametric modeling method for aileron mechanisms based on CATIA VBA secondary development according to claim 2, characterized in that, Key geometric dimensions include key positioning dimensions, contour dimensions, and structural dimensions.
4. The parametric modeling method for aileron mechanisms based on CATIA VBA secondary development according to claim 1, characterized in that, Step 2 is as follows: Step 2.1: Initialize the macro recording environment. In the CATIA software environment, call the macro function module, create a user macro library, specify the storage path, create parameterized macro files, and create form modules and part modules respectively, thereby laying the foundation for subsequent structured and procedural parametric modeling. Step 2.2: In the parts module constructed in step 2.1, the modeling process of the parts is recorded in a programmed manner. The macro recording function is started, and the modeling process of multiple key parts of the aileron mechanism is recorded in a programmed manner in sequence. The key parts include servo mount (1), servo (2), actuator (3), rocker arm pin (4), rocker arm (5), rudder shaft (6), rocker arm mount (7), rudder surface (8), and bearing mount (9). Step 2.3: After recording is completed, the CATIA software automatically generates and stores the corresponding CATProduct assembly file, CATPart part file, and VBA macro code file that records the modeling process to ensure the repeatability of the modeling process and the adjustability of key dimensional parameters. Step 2.4: After recording is complete, manually supplement and edit the original VBA code and correct its properties.
5. The parametric modeling method for aileron mechanisms based on CATIA VBA secondary development according to claim 4, characterized in that, The specific correction method is to locate the code module corresponding to the target part in the VBA development environment, and then call the corresponding properties and methods of the part document object to achieve precise setting of the identification information.
6. The parametric modeling method for aileron mechanisms based on CATIA VBA secondary development as described in claim 1, characterized in that, Step 3 specifically involves; Step 3.1: In the CATIA assembly design module, start the macro recording function of CATIA, and based on the overall assembly relationship of the existing three-dimensional assembly model of the aileron mechanism, create a new assembly Product file and import the Part files of each part generated and stored in step 2.3 in sequence. The part files for each component include (1), servo motor (2), actuator stick (3), rocker arm pin (4), rocker arm (5), rudder shaft (6), rocker arm mount (7), rudder surface (8), and bearing housing (9); Step 3.2: Based on the functional principle and structural requirements of the aileron mechanism, apply assembly constraints to determine the spatial orientation relationship between the parts and reproduce the complete aileron mechanism assembly.
7. The parametric modeling method for aileron mechanisms based on CATIA VBA secondary development according to claim 6, characterized in that, Assembly constraints are applied through programmed operations in a preset order, and the order and logic of constraint application are as follows: Step 3.2.1: Establish fixed constraints between the servo mount (1) and the rocker arm (7) and determine their relative positions; Step 3.2.2: Sequentially establish coaxial constraints between the servo mount (1) and the servo (2), between the servo (2) and the actuator (3), and between the actuator (3) and the rocker arm (5) and the rocker arm pin (4); Step 3.2.3: Establish coaxial constraints between the rocker arm (5), rocker arm seat (7), rudder shaft (6), rudder surface (8), and bearing seat (9); Step 3.2.4: Apply key distance dimension constraints and height direction position constraints to ensure that the entire assembly is fully constrained and that the degrees of freedom of movement meet the design requirements.
8. The parametric modeling method for aileron mechanisms based on CATIA VBA secondary development according to claim 1, characterized in that, Step 4 specifically involves: Step 4.1: In the CATIA VBA editing interface, open the overall assembly macro code recorded in Step 3. In the assembly logic framework code generated in Step 3, locate the parts that are introduced to each part and locate the code module that calls the specific external part file. Step 4.2: Use the parametric modeling template code of the corresponding part generated in Step 2 as a subroutine or procedure call to replace the original part import instruction.
9. The parametric modeling method for aileron mechanisms based on CATIA VBA secondary development according to claim 8, characterized in that, The code replacement operation involves replacing the code used to load external part files from a specified path with the VBA program code recorded in step 2.2, which is used to directly generate the actuator geometry model, using the AddComponentsFromFiles method. To ensure the integrated code executes correctly, during the replacement process, necessary pre-declarations and post-processing code are added before and after the direct drawing code to maintain the correct program running environment.
10. The parametric modeling method for aileron mechanisms based on CATIA VBA secondary development according to claim 1, characterized in that, Step 5 is as follows: Step 5.1: Write the main control VBA code and define a set of core driving parameters that control the macroscopic shape and key structural dimensions of the aileron mechanism; In the CATIA VBA editing environment, create a custom user form UserForm and name the form module "UseForm1". Design the completed interface layout and place controls on the form for parameter input and command operation. Add three text label Label controls and define the displayed text as "Actuator Length", "Base Spacing", and "Rocker Arm Height" respectively. For each label, add a text box control to receive the specific parameter values entered by the user. Add two command button controls, labeled "Draw" and "Cancel" respectively, to perform the generation of the parametric model and the closing of the form; Step 5.2: Develop a graphical user interface and bind the core driver parameters to the input controls in the interface. Configure event-driven logic for the command buttons in the form. Double-click the "Draw" button to enter the VBA code editing page for the command button. Embed the VBA code that has been integrated and debugged in step 4 and can completely generate the aileron mechanism assembly into this event process. Change the original program's startup entry point Sub CATMain() to the execution command Private Sub CommandButton1_Click() corresponding to this event, thereby ensuring that this code responds to the user's "Draw" operation and executes. Similarly, write the code Me.Hide for the "Cancel" command button to realize the function of closing the form when clicked. Step 5.3 encapsulates the entire code system and interface, enabling the automatic updating and reconstruction of the entire aileron mechanism model by modifying interface parameters; In the event code of the "Draw" button, establish the driving link between user input parameters and internal model dimension variables; implement parametric compilation for the three key dimensions of actuator length, distance between the two bases, and rocker arm height; locate and identify the variables length9, length10, and length11 representing these three dimensions in the code, and replace them with the input values obtained from the corresponding text boxes on the form, namely TextBox1.Text, TextBox2.Text, and TextBox3.Text; after completing the code adjustment, perform overall compilation and runtime testing; when the macro is run, a parameter input interface will pop up. After the user enters valid parameter values and clicks the "Draw" button, the system will automatically generate a parametric assembly model of the aileron mechanism that conforms to the specified dimensions.