A method for associating equipment and cabin in three-dimensional space based on secondary development of CATIA

By building a VBA plugin in the CATIA secondary development environment, the automated analysis and real-time updates of the three-dimensional spatial association between equipment and compartments are realized, which solves the problems of complex and error-prone data management in ship design and improves design quality and safety.

CN122490698APending Publication Date: 2026-07-31DALIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DALIAN UNIV OF TECH
Filing Date
2026-05-12
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies struggle to automate and update the three-dimensional spatial relationship between ship equipment and cabins, resulting in complex data management, a high probability of errors, and an inability to provide accurate spatial relationship analysis, thus impacting design quality and safety.

Method used

By building a VBA plugin in the CATIA secondary development environment, functions such as interference checking, Boolean operations, volume calculation, and model change monitoring are realized. A three-dimensional assembly model of equipment and compartments is constructed, and parameter fields are preset in the model properties to automatically perform spatial correlation analysis and parameter write-back, and monitor model changes in real time.

Benefits of technology

It has achieved fully automated processing of the relationship between equipment and cabin space, improved the accuracy of data calculation and work efficiency, ensured the consistency between data and models, provided accurate spatial correlation data support, and improved the reliability and efficiency of design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122490698A_ABST
    Figure CN122490698A_ABST
Patent Text Reader

Abstract

This invention discloses a method for three-dimensional spatial association of equipment and compartments based on CATIA secondary development, relating to the field of ship three-dimensional design technology. By building a dedicated VBA plugin through CATIA secondary development, it deeply integrates CATIA's native API interface with the three-dimensional spatial association analysis requirements of ship equipment and compartments. This achieves automated analysis of equipment and compartment spatial associations, standardized parameter write-back, and automatic parameter updates after model changes. Compared to traditional manual analysis and manual parameter entry, this significantly improves the efficiency and calculation accuracy of spatial association analysis in ship three-dimensional design. Furthermore, by pre-setting dedicated parameter fields, establishing unified coding rules, and generating traceable reports, it achieves standardized storage and management of equipment and compartment spatial association data. This provides accurate and real-time three-dimensional spatial association data support for subsequent process planning, spatial layout optimization, and equipment installation planning in ship design, adapting to the model iteration and change requirements throughout the entire ship three-dimensional design process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ship three-dimensional design technology, specifically a method for associating equipment and cabins in three-dimensional space based on CATIA secondary development. Background Technology

[0002] In the field of marine engineering, structural safety assessment is a core component of ensuring the safe operation of ships in complex marine environments. All analytical work relies on a large amount of accurate basic data, among which the three-dimensional spatial correlation information between ship equipment and compartments is an indispensable key data type. This information accurately reflects the actual distribution of ship equipment in three-dimensional space, as well as the spatial relationships between equipment and various compartments. It provides crucial data for core tasks such as ship structural strength calculation, collision damage simulation, process planning, and spatial layout optimization, directly impacting the overall quality of ship design and the safety of subsequent construction and operation phases. As modern ship design rapidly develops towards refinement, digitalization, and intelligence, the complexity of the overall ship structure continues to increase, the types and quantities of ship equipment have significantly increased, and the layout design of compartments has become more complex. This places higher industry demands on the accuracy, comprehensiveness, and real-time nature of equipment-company compartment spatial correlation information. Currently, CATIA, as a mainstream 3D design software, is widely used in the field of ship 3D design. However, its native functions are difficult to directly match the personalized and automated needs of ship equipment-company compartment spatial correlation analysis, becoming a key technical bottleneck restricting the efficiency improvement of ship digital design processes.

[0003] In existing ship design processes, the processing of information related to ship equipment and cabin spaces still relies primarily on traditional manual operations. This approach exposes numerous technical shortcomings and is ill-suited to the evolving needs of modern ship design. Methods such as manual recording, naming conventions, or external data table maintenance all require manual data entry and updates, lacking an effective automatic association mechanism between the 3D model and attribute data. This leaves the model and data in an independent state, creating data fragmentation. This significantly increases the overall complexity of data management and raises the probability of errors during data entry and maintenance, making it difficult to correlate and verify the data with the actual 3D model in real time. Ship design involves frequent model iterations and changes; adjustments to equipment spatial locations and modifications to cabin geometry are common design behaviors. Traditional methods require manual re-verification and modification of equipment cabin attribution information, a tedious and time-consuming process prone to data omissions or errors. This prevents synchronized updates between data and the model, resulting in inconsistencies between model status and attribute data, severely impacting the reliability of subsequent analytical results. Meanwhile, existing technologies lack comprehensive quantitative processing for analyzing the spatial relationship between equipment and compartments. They only extract a small number of basic geometric parameters as input for analysis, and cannot systematically calculate all compartments where the equipment is located and their space proportions. This makes it difficult to comprehensively and accurately reflect the actual spatial relationship between equipment and compartments, and cannot provide quantitative spatial correlation data to support refined design. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a method for three-dimensional spatial association between equipment and compartments based on CATIA secondary development. By building a secondary development environment adapted to CATIA, a VBA plugin with multiple functions such as interference checking, Boolean operations, volume calculation, parametric design, and model change monitoring is developed. By pre-setting parameter fields in the equipment model attributes, a ship assembly model is constructed. The three-dimensional solid models of each compartment and equipment are uniformly assembled into the Product assembly file, and each Part unit is assigned a unique identifier code and basic attributes to ensure the accuracy and uniqueness of the model. In the automated spatial association analysis stage, the plugin sequentially performs steps such as interference checking screening, volume intersection calculation, and proportion calculation to accurately quantify the spatial relationship between equipment and compartments, generating a structured volume proportion table. Subsequently, the plugin automatically writes the calculated parameters back to the pre-set parameter fields of the equipment model, realizing automatic association between the model and data. An automatic update mechanism for model changes is introduced. By monitoring model changes in real time, when the equipment position or compartment structure is modified, the spatial association analysis and parameter write-back process is automatically triggered to ensure that the parameter field data remains consistent with the actual state of the ship assembly model.

[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for associating equipment and cabins in three-dimensional space based on CATIA secondary development, the method comprising: S1: In the visual development environment, introduce the CATIA type library and API interface, write plugin code based on VBA language, compile and generate VBA plugins that can be loaded by CATIA, and at the same time preset dedicated parameter fields in the CATIA device model properties to complete the construction of the CATIA secondary development environment and the configuration of the parameter storage carrier. S2: In CATIA, construct independent Part units for equipment and compartments, assign unique identifiers, add basic attributes, integrate all Part units into a unified Product assembly file, and position them according to design requirements to complete the construction of a unified three-dimensional assembly model for ship equipment and compartments. S3: Run the VBA plugin to perform interference check screening, intersection volume calculation, volume ratio solution and sorting on the selected equipment in sequence, and generate a volume ratio table containing quantitative data on the spatial relationship between equipment and compartment, thus completing the automated spatial relationship analysis between equipment and compartment. S4: The VBA plugin calls the CATIA parametric design API to write the quantitative data and main assigned compartment name from the volume percentage table into the equipment preset parameter fields. After the parameters are written, a parameter write-back completion report is generated and output, realizing the automatic write-back and recording of spatial association parameters. S5: Enable the VBA plugin's real-time model change monitoring function. After capturing model changes of equipment or compartments, it automatically triggers spatial correlation analysis and parameter write-back process to realize automatic updates of equipment spatial correlation parameter fields.

[0006] Furthermore, in S1, a secondary development environment adapted to CATIA is built in the visual development environment, CATIA's type library and API interface are introduced, and plug-in code is written based on VBA language. The plug-in code includes function call modules for interference checking, Boolean operation, volume calculation, parametric design, and model change monitoring. The completed plug-in code is compiled to generate a VBA plug-in that can be recognized and loaded by CATIA, and the plug-in is loaded into the CATIA software and its functions are verified.

[0007] Furthermore, in S1, the attributes of the device Part unit are configured in the CATIA software, and a special parameter field for storing space association parameters is preset. The parameter field includes the Volume-Ratio series field and the Main-Comp field, which provides a field carrier for subsequent parameter write-back.

[0008] Furthermore, in S2, the specific steps for constructing independent Part units for equipment and compartments in CATIA and assigning them unique identifiers are as follows: Establish unified coding rules for ship compartments and equipment; assign unique character prefixes to compartments and equipment to distinguish their types; set a fixed character as the prefix for compartment Part units and another fixed character as the prefix for equipment Part units; and follow the prefix with consecutive Arabic numerals to form a complete code. This combination of prefix and numerical sequence ensures that the code types are distinguishable and the sequence numbers are unique. In the CATIA software, add a custom identifier coding attribute field to all compartment and equipment Part units, set the field type to text, and incorporate it into... The basic attribute system of the Part unit; according to the compilation rules, the unique code content is entered one by one in the identification code attribute field of each compartment and equipment Part unit. At the same time, the file name of the Part unit is associated and matched with the identification code entered in the attribute to ensure that the file name and identification code are consistent; a code uniqueness verification module is built through the developed CATIA VBA plugin. After the code is entered, the plugin automatically traverses all compartments and equipment Part units in the ship's Product assembly file and performs a full verification of the identification code of each unit. If a duplicate code is detected, a pop-up prompt is triggered immediately, and the attribute saving operation of the Part unit is prohibited until the duplicate problem is corrected.

[0009] Furthermore, in S2, basic attributes are added to each Part unit. These basic attributes include spatial position coordinates, center of gravity coordinates, and geometric dimensions. The parameter values ​​of these basic attributes are consistent with the actual design parameters of the ship.

[0010] Furthermore, in S3, the specific steps of the initial screening of interference checks are as follows: run the loaded VBA plugin in CATIA, select the equipment part unit to be analyzed through the plugin's operation interface, and the plugin automatically calls CATIA's interference check API in the background. According to the traversal rule of ascending order of compartment identification code, the selected equipment part unit and all compartment part units in the ship assembly model are subjected to interference checks one by one to determine whether there is a three-dimensional spatial intersection between the equipment and the compartment. The results of the interference check are organized into a candidate intersection list, which contains three types of information: equipment identification code, compartment identification code, and intersection existence determination result. Based on the determination result, the plugin marks the compartments with spatial intersection as candidate compartments of the corresponding equipment.

[0011] Furthermore, in S3, the specific steps for calculating the intersection volume are as follows: The plugin automatically retrieves the temporarily stored intersection candidate list through a preset data reading interface, filters out the equipment-cabinet combinations whose candidate cabin marker field is "yes", and groups and sorts them according to the equipment identifier code; for each equipment-cabinet combination, the plugin first calls the CATIA Boolean operation API to create a Boolean operation instance, sets the corresponding equipment Part unit as the target entity and the cabin Part unit as the tool entity, specifies the operation type as intersection operation and executes the operation to generate the intersection entity of the equipment and the cabin in three-dimensional space, and assigns a temporary unique identifier to the intersection entity to associate it with the corresponding equipment-cabinet combination; after the operation is completed, the plugin calls the CATIA volume calculation API, passes in the geometric feature objects of the intersection entity and the original equipment Part unit respectively, and executes the volume calculation method in sequence to obtain the intersection volume of the equipment and each candidate cabin. and the total volume of the equipment part unit itself .

[0012] Furthermore, in S3, the specific steps for calculating and sorting the volume proportions are as follows: the plug-in retrieves all device-cabin combinations corresponding to the specified cache area. and The volume data is used to calculate the volume percentage of each device in each candidate compartment by calling the built-in preset formula calculation module. The formula is: The plugin then groups all volume percentage results for the same device according to the device identification code. Within each group, the percentage results are sorted in descending order from high to low. If there are cases with the same percentage value, the cabin identification code is used as the secondary sorting criterion. A structured volume percentage table is generated, which contains five fixed columns: device identification code, cabin identification code, intersection volume, total device volume, and volume percentage.

[0013] Furthermore, in S4, the plugin calls CATIA's parametric design API to read the volume ratio table in the cache area, matches the corresponding device Part unit according to the device identification code, and completes the parameter writing according to the correspondence between fields and data: the first, second, and third largest volume ratio data of the same device after being sorted in descending order of volume ratio are written into the Volume-Ratio-1, Volume-Ratio-2, and Volume-Ratio-3 subfields of the corresponding device Part unit, respectively; the compartment name corresponding to the largest volume ratio value of the same device in the volume ratio table is extracted and written into the Main-Comp field of the corresponding device Part unit, and the compartment names corresponding to the second and third largest volume ratio values ​​are written into the Sub-Comp-1 and Sub-Comp-2 fields of the corresponding device Part unit, respectively; when all the specified data has been written, the plugin automatically generates a parameter write-back completion report, which includes the device identification code, write-back field name, and write-back data content to record the parameter write-back result.

[0014] Beneficial effects Compared with existing technologies, this method for associating equipment and cabin in three-dimensional space based on CATIA secondary development has the following advantages: I. This invention utilizes CATIA secondary development to create a customized VBA plugin, deeply integrating the software's native API interface with the 3D spatial correlation analysis requirements of ship equipment and compartments. This achieves fully automated processing of spatial correlation analysis and parameter write-back, completely replacing traditional manual analysis and data entry methods. This significantly improves the efficiency and accuracy of spatial correlation analysis in ship 3D design. Simultaneously, by pre-setting dedicated parameter fields in the equipment model and establishing unified coding rules for compartments and equipment, a standardized spatial correlation data storage and management system is established. This breaks down the data silos between 3D models and attribute data, allowing for deep binding of spatial correlation data with the 3D model. Real-time correspondence and verification are possible, effectively reducing the complexity and error probability of data management, and providing accurate and standardized basic data support for subsequent stages of ship design.

[0015] Second, this invention establishes a real-time model change monitoring function, relying on CATIA's model change event listening capabilities, to achieve full and real-time capture of various change behaviors of equipment and compartment models. Once a model change is detected, it automatically triggers a full-process recalculation of spatial correlation analysis and parameter write-back, completing the synchronous update of parameters without manual intervention. This ensures that the spatial correlation data and the actual state of the model remain highly consistent, effectively solving the technical defects of data update lag and cumbersome manual verification in traditional methods. At the same time, it completes the quantitative solution of the spatial relationship between equipment and compartments through professional spatial calculations, breaking through the limitation of existing technologies that only extract a small number of geometric parameters. It comprehensively and accurately reflects the actual spatial relationship between equipment and compartments, enriching the input data dimensions for ship structural safety assessment, process planning, and other work, improving the reliability of subsequent related analysis and planning work. Moreover, the method can be directly integrated into the existing CATIA design platform, with low modification costs and easy promotion in the ship design industry.

[0016] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0018] Figure 1 A flowchart of a method for associating equipment and cabins in three-dimensional space based on CATIA secondary development; Figure 2 This is a flowchart of step S2 of a method for associating equipment and cabins in a three-dimensional space based on CATIA secondary development. Detailed Implementation

[0019] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0020] This invention provides a method for 3D spatial association between equipment and compartments based on CATIA secondary development. By building a CATIA-compatible secondary development environment, a VBA plugin with multiple functions such as interference checking, Boolean operations, volume calculation, parametric design, and model change monitoring is developed. By pre-setting parameter fields in the equipment model attributes, a ship assembly model is constructed. The 3D solid models of various compartments and equipment are uniformly assembled into the Product assembly file, and each Part unit is assigned a unique identifier code and basic attributes to ensure the accuracy and uniqueness of the model. In the automated spatial association analysis stage, the plugin sequentially performs interference checking screening, volume intersection calculation, and proportion calculation steps to accurately quantify the spatial relationship between equipment and compartments, generating a structured volume proportion table. Subsequently, the plugin automatically writes the calculated parameters back to the pre-set parameter fields of the equipment model, realizing automatic association between the model and data. An automatic update mechanism for model changes is introduced. By monitoring model changes in real time, when the equipment position or compartment structure is modified, the spatial association analysis and parameter write-back process is automatically triggered to ensure that the parameter field data remains consistent with the actual state of the ship assembly model. like Figure 1 As shown, S1: In the visual development environment, the CATIA type library and API interface are introduced, the plugin code is written based on the VBA language, and the VBA plugin that can be loaded by CATIA is compiled. At the same time, the dedicated parameter fields are preset in the CATIA device model properties, and the CATIA secondary development environment and parameter storage carrier are configured. A VBA visual development environment compatible with CATIA software is selected, and the native type library and full API interfaces of CATIA are actively introduced into the development environment. The introduced API interfaces cover five core categories: interference checking, Boolean operation, volume calculation, parametric design, and model change monitoring, providing underlying technical support for the implementation of plug-in functions.

[0021] The plugin code is written using the VBA programming language and designed according to a modular approach. It is divided into four modules: interference checking, Boolean operations, volume calculation, parametric design, and model change monitoring. Each module independently implements its corresponding function and can call upon each other. The interference checking module calls CATIA's interference checking API to quickly determine the intersection of three-dimensional spaces between entities. The Boolean operations module calls CATIA's Boolean operations API to support the triggering and execution of basic Boolean operations such as intersection, union, and difference. The volume calculation module calls CATIA's geometric feature volume calculation API to accurately solve the volume of various three-dimensional entities. The parametric design module calls CATIA's model attribute editing API to read, write, and modify equipment model attribute fields. The model change monitoring module calls CATIA's model change event listening API to capture model state changes in real time. After the code is written, it is compiled to generate a VBA plugin program that can be directly recognized and loaded by CATIA software. After loading the plugin into CATIA software, the plugin's functionality is verified by simulating simple entity interference checks and volume calculations to ensure that each module operates normally and that data interaction is error-free.

[0022] In CATIA software, the custom attribute system of the equipment Part unit is configured, and a dedicated parameter field is preset for storing space-related parameters. This parameter field includes a Volume-Ratio series field and a Main-Comp field. The Volume-Ratio series field is set to numeric type and can be flexibly expanded according to the compartment code to store the volume ratio data of the equipment in different compartments. The Main-Comp field is set to text type to store the name of the main compartment to which the equipment belongs. The above-mentioned dedicated parameter fields are formally incorporated into the attribute system of the equipment Part unit, completing the configuration of the parameter storage carrier and preparing for the automatic write-back of space-related parameters in the future.

[0023] like Figure 2 As shown, S2: In CATIA, construct independent Part units for equipment and compartments, assign unique identifiers, add basic attributes, integrate all Part units into a unified Product assembly file, and position them according to design requirements to complete the construction of a unified three-dimensional assembly model for ship equipment and compartments. Establish unified coding rules for ship compartments and equipment parts, and assign exclusive fixed character prefixes to compartments and equipment to distinguish their types. The prefix for compartment parts is set with one type of fixed characters, and the prefix for equipment parts is set with another type of fixed characters. The prefix is ​​followed by a continuous and non-repeating Arabic numeral sequence number, forming a complete coding form of prefix + numeric sequence number. This form ensures that the coding types of compartments and equipment can be quickly distinguished and that the coding sequence number of the same type is not repeated.

[0024] In CATIA, each compartment and piece of equipment in the ship is built as an independent Part unit. Each Part unit contains only a 3D geometric model of a single compartment or piece of equipment, without redundant geometric entities. In CATIA, a custom identification code attribute field is added to all compartment and equipment Part units. The field type is set to text and incorporated into the basic attribute system of the Part unit. According to the above compilation rules, the unique code content is entered one by one in the identification code attribute field of each compartment and equipment Part unit. At the same time, the file name of the Part unit is strictly associated and matched with the identification code entered in the attribute, so that the file name and the identification code are completely consistent, realizing a one-to-one correspondence between the model file and the attribute code.

[0025] A unique code verification module is built using the developed CATIA VBA plugin. After the code is entered, the module is triggered to perform the verification operation. The plugin will automatically traverse all the compartments and equipment Part units to be integrated, read the identification code attribute field content of each unit and perform a full comparison. If a duplicate code is detected, a pop-up prompt will be triggered immediately, clearly displaying the content of the duplicate code and the corresponding Part unit name. At the same time, the attribute saving operation of the Part unit with the duplicate code will be directly prohibited until the user corrects the duplicate code problem, ensuring that the identification code of all Part units is unique and without duplicates.

[0026] Basic attributes are added to all compartments and equipment Part units that have completed coding verification. These basic attributes include three categories: spatial position coordinates, centroid coordinates, and geometric dimensions. The spatial position coordinates are the X, Y, and Z three-dimensional coordinates based on the unified spatial coordinate system of ship design. The centroid coordinates are the Xg, Yg, and Zg three-dimensional centroid coordinates of the entity. The geometric dimensions are set according to the geometric shape of the compartments and equipment. For example, the length, width, and height are set for regular square entities, and the diameter and height are set for circular and cylindrical entities. The parameter values ​​of all basic attributes are strictly consistent with the actual design parameters of the ship to ensure that the model attributes match the actual design.

[0027] All compartments and equipment Parts that have been assigned identification codes, added basic attributes, and verified are imported into the newly created CATIAProduct assembly file. According to the actual design requirements of the ship, each Part is positioned and assembled in three-dimensional space to ensure that the spatial position of each compartment and equipment entity is consistent with the spatial layout of the actual ship design, thus completing the construction of a unified three-dimensional assembly model of ship equipment and compartments.

[0028] S3: Run the VBA plugin to perform interference check screening, intersection volume calculation, volume ratio solution and sorting on the selected equipment in sequence, and generate a volume ratio table containing quantitative data on the spatial relationship between equipment and compartment, thus completing the automated spatial relationship analysis between equipment and compartment. Run the loaded VBA plugin in CATIA software. Through the plugin's visual interface, select one or more device Part units to be spatially correlated. After receiving the selection command, the plugin automatically triggers the interference check process.

[0029] The plugin calls CATIA's interference check API and performs a three-dimensional spatial interference check on each selected equipment part unit and all compartment part units in the ship's unified three-dimensional assembly model according to the ascending traversal rule of compartment identification codes. By analyzing the geometric boundaries and spatial coordinate range of the equipment and compartment entities, it determines whether there is a three-dimensional spatial intersection between them.

[0030] The plugin organizes all interference check results into a candidate intersection list. This list is in structured data format and contains three core types of information: equipment identification code, compartment identification code, and intersection existence determination result. Based on the intersection existence determination result, the plugin marks the compartments that are determined to have spatial intersection as candidate compartments of the corresponding equipment. The plugin only performs subsequent intersection volume calculation operations on the candidate compartments and eliminates compartments that do not have intersection, thereby reducing the amount of subsequent calculations.

[0031] The plugin automatically retrieves the intersection candidate list temporarily stored in the cache area through the built-in temporary data reading interface, filters the list data, extracts the equipment-cabin combinations marked as "yes" in the candidate cabins, and groups and sorts them in ascending order according to the equipment identification code.

[0032] For each equipment-cabin combination in each group, the plugin first calls the CATIA Boolean operation API to create a Boolean operation instance, sets the geometric entity of the corresponding equipment Part unit as the target entity and the geometric entity of the cabin Part unit as the tool entity, explicitly specifies the operation type as intersection operation and triggers execution, generating the intersection entity of the equipment and cabin in three-dimensional space; at the same time, it assigns a temporary unique identifier to the intersection entity, which adopts the form of equipment identifier code-cabin identifier code, to realize the association between the intersection entity and the corresponding equipment-cabin combination and avoid data confusion.

[0033] After the Boolean intersection operation is completed, the plugin calls the CATIA volume calculation API, passing the geometric feature objects of the intersection entity and the original equipment Part unit into the API, and then executing the volume calculation methods in the API in sequence to obtain the intersection volume of the equipment and each candidate compartment. and the total volume of the device Part unit itself. After the calculation is completed, the volume data is associated with the corresponding equipment-compartment combination and stored in the cache area specified by the plugin.

[0034] The plugin retrieves all device-cabin combinations corresponding to the specified cache area. and The volume data is used to call the plugin's built-in numerical calculation module to calculate the volume percentage of each device in each candidate compartment according to a preset formula. The formula is: Convert the volume percentage result to percentage form and retain two decimal places.

[0035] After the volume percentage calculation is completed, the plugin groups all volume percentage results for the same device according to the device identification code, and then, for each group, calculates the volume percentage results according to... The values ​​are sorted in descending order from highest to lowest; if there are multiple compartments... In cases where values ​​are the same, the cabin identification code in ascending order is used as a secondary sorting criterion to ensure the uniqueness of the sorting results.

[0036] The plugin generates a structured volume percentage table based on the sorted volume percentage data. This volume percentage table contains five fixed columns: equipment identification code, compartment identification code, intersection volume, total equipment volume, and volume percentage. All data is organized according to the above sorting rules and stored in the plugin's designated cache area, providing complete and accurate quantitative data support for subsequent writing back of spatial association parameters.

[0037] S4: The VBA plugin calls the CATIA parametric design API to write the quantitative data and main assigned compartment name from the volume percentage table into the equipment preset parameter fields. After the parameters are written, a parameter write-back completion report is generated and output, realizing the automatic write-back and recording of spatial association parameters. The plugin calls CATIA's parametric design API, which reads the volume percentage table data stored in the plugin's specified cache area. Using the equipment identification code as the unique matching basis, the data in the volume percentage table is matched with the corresponding equipment Part unit in the ship's unified 3D assembly model to ensure that the data corresponds one-to-one with the equipment.

[0038] After the data and equipment are matched, the plugin performs the writing operation of spatial association parameters according to the correspondence between fields and data: the volume percentage data of the equipment and each candidate compartment is written into the Volume-Ratio series fields of the corresponding equipment Part unit. The Volume-Ratio series fields correspond one-to-one with the compartment identification code, realizing the standardized storage of the volume percentage data of the equipment in different compartments; at the same time, the compartment name corresponding to the maximum volume percentage value of the same equipment is extracted from the volume percentage table, and the compartment name is written into the Main-Comp field of the corresponding equipment Part unit as the main assigned compartment of the equipment.

[0039] Once all specified spatial association parameters have been written, the plugin automatically triggers the report generation function, generating a parameter write-back completion report. This report is in structured table format and includes three core types of information: device identification code, write-back field name, and write-back data content. It clearly records the parameter write-back object, write-back data, and values ​​for each device. The report can be directly displayed in the CATIA software interface and can also be exported to a common document format, enabling traceability and queryability of spatial association parameter write-back results.

[0040] S5: Enable the VBA plugin's real-time model change monitoring function. After capturing model changes of equipment or compartments, it automatically triggers spatial correlation analysis and parameter write-back process to realize automatic updates of equipment spatial correlation parameter fields. Enable the real-time monitoring function for model changes in CATIA with the VBA plugin loaded. This function establishes a full real-time monitoring mechanism for all equipment and compartment parts in the unified 3D assembly model of the ship by calling CATIA's model change event listening API. The types of model changes monitored include geometric changes (such as equipment size modification and compartment space structure adjustment), spatial position changes (such as equipment translation and rotation, and compartment spatial position adjustment), and core attribute information changes (such as identification code modification).

[0041] When the plugin detects any of the above-mentioned model changes in any device or cabin Part unit through the monitoring mechanism, it will automatically trigger the preset linkage process without manual intervention. The plugin will re-execute the third step of the invention, the automated spatial association analysis of the device and cabin, and the fourth step, the automatic write-back operation of the spatial association parameters.

[0042] During the re-execution process, the plugin will perform interference checks, intersection volume calculations, and volume ratio solutions based on the modified equipment and compartment model data, generating an updated volume ratio table. The new volume ratio data and the name of the primary compartment will be directly overwritten into the Volume-Ratio series fields and Main-Comp fields corresponding to the equipment Part unit, realizing automatic and real-time updates of equipment spatial association parameter fields. This ensures that the spatial association parameters of the equipment always remain highly consistent with the actual state of the model, adapting to the model iteration and change requirements in the ship 3D design process.

[0043] This invention utilizes a dedicated VBA plugin developed through secondary development of CATIA to deeply integrate CATIA's native API interface with the 3D spatial correlation analysis requirements of ship equipment and compartments. This enables automated analysis of equipment and compartment spatial correlations, standardized parameter write-back, and automatic parameter updates after model changes. Compared to traditional manual analysis and parameter entry methods, this significantly improves the efficiency and accuracy of spatial correlation analysis in ship 3D design. Furthermore, by pre-setting dedicated parameter fields, establishing unified coding rules, and generating traceable reports, it achieves standardized storage and management of equipment and compartment spatial correlation data. This provides accurate and real-time 3D spatial correlation data support for subsequent process planning, spatial layout optimization, and equipment installation planning in ship design, adapting to the model iteration and change requirements throughout the entire ship 3D design process.

[0044] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for three-dimensional spatial association between equipment and cabins based on CATIA secondary development, characterized in that, The method includes: S1: In the visual development environment, introduce the CATIA type library and API interface, write plugin code based on VBA language, compile and generate VBA plugins that can be loaded by CATIA, and at the same time preset dedicated parameter fields in the CATIA device model properties to complete the construction of the CATIA secondary development environment and the configuration of the parameter storage carrier. S2: In CATIA, construct independent Part units for equipment and compartments, assign unique identifiers, add basic attributes, integrate all Part units into a unified Product assembly file, and position them according to design requirements to complete the construction of a unified three-dimensional assembly model for ship equipment and compartments. S3: Run the VBA plugin to perform interference check screening, intersection volume calculation, volume ratio solution and sorting on the selected equipment in sequence, and generate a volume ratio table containing quantitative data on the spatial relationship between equipment and compartment, thus completing the automated spatial relationship analysis between equipment and compartment. S4: The VBA plugin calls the CATIA parametric design API to write the quantitative data and main assigned compartment name from the volume percentage table into the equipment preset parameter fields. After the parameters are written, a parameter write-back completion report is generated and output, realizing the automatic write-back and recording of spatial association parameters. S5: Enable the VBA plugin's real-time model change monitoring function. After capturing model changes of equipment or compartments, it automatically triggers spatial correlation analysis and parameter write-back process to realize automatic updates of equipment spatial correlation parameter fields.

2. The method for three-dimensional spatial association between equipment and cabins based on CATIA secondary development according to claim 1, characterized in that, In step S1, a secondary development environment adapted to CATIA is built in the visual development environment, CATIA's type library and API interface are introduced, and plug-in code is written based on the VBA language. The plug-in code includes function call modules for interference checking, Boolean operation, volume calculation, parametric design, and model change monitoring. The completed plug-in code is compiled to generate a VBA plug-in that can be recognized and loaded by CATIA, and the plug-in is loaded into the CATIA software and its functions are verified.

3. The method for three-dimensional spatial association between equipment and cabins based on CATIA secondary development according to claim 1, characterized in that, In step S1, the attributes of the device Part unit are configured in the CATIA software, and a special parameter field for storage space association parameters is preset. The parameter field includes the Volume-Ratio series fields and the Main-Comp field, which provide a field carrier for subsequent parameter write-back.

4. The method for three-dimensional spatial association between equipment and cabins based on CATIA secondary development according to claim 1, characterized in that, In S2, the specific steps for constructing independent Part units for equipment and compartments in CATIA and assigning them unique identifiers are as follows: Establish unified coding rules for ship compartments and equipment, setting exclusive character prefixes for compartments and equipment to distinguish types. The prefix for compartment Part units is set to a fixed character, and the prefix for equipment Part units is set to another fixed character. A series of Arabic numerals are appended after the prefix to form a complete code. This combination of prefix and numerical sequence ensures that the code types are distinguishable and the sequence numbers are not duplicated. In CATIA software, a custom identifier coding attribute field is added to all compartment and equipment Part units. This field is set to text type and incorporated into the basic attribute system of the Part unit. According to the coding rules, the exclusive coding content is entered one by one into the identifier coding attribute field of each compartment and equipment Part unit. Simultaneously, the filename of the Part unit is associated and matched with the identifier code entered in the attribute to ensure consistency between the filename and the identifier code. A unique code verification module is built using the developed CATIA VBA plugin. After the code is entered, the plugin automatically traverses all compartments and equipment parts in the ship's Product assembly file and performs a full verification of the identification code of each part. If a duplicate code is detected, a pop-up prompt is triggered immediately, and the attribute saving operation of that part is prohibited until the duplicate problem is corrected.

5. The method for three-dimensional spatial association between equipment and cabin based on CATIA secondary development according to claim 4, characterized in that, In S2, basic attributes are added to each Part unit. These basic attributes include spatial position coordinates, center of gravity coordinates, and geometric dimensions. The parameter values ​​of these basic attributes are consistent with the actual design parameters of the ship.

6. The method for three-dimensional spatial association between equipment and cabins based on CATIA secondary development according to claim 4, characterized in that, In S3, the specific steps of the initial screening of interference checks are as follows: Run the loaded VBA plugin in CATIA, select the equipment part unit to be analyzed through the plugin's operation interface, and the plugin automatically calls CATIA's interference check API in the background. According to the traversal rule of ascending order of compartment identification code, the selected equipment part unit and all compartment part units in the ship assembly model are subjected to interference checks one by one to determine whether there is a three-dimensional spatial intersection between the equipment and the compartment. The results of the interference check are organized into an intersection candidate list, which contains three types of information: equipment identification code, compartment identification code, and intersection existence determination result. According to the determination result, the plugin marks the compartments with spatial intersection as candidate compartments of the corresponding equipment.

7. The method for three-dimensional spatial association between equipment and cabins based on CATIA secondary development according to claim 1, characterized in that, In step S3, the specific steps for calculating the intersection volume are as follows: The plugin automatically retrieves the temporarily stored intersection candidate list through a preset data reading interface, filters out the equipment-cabin combinations whose candidate cabin marker field is "yes", and groups and sorts them according to the equipment identifier code; for each equipment-cabin combination, the plugin first calls the CATIA Boolean operation API to create a Boolean operation instance, sets the corresponding equipment Part unit as the target entity and the cabin Part unit as the tool entity, specifies the operation type as intersection operation and executes the operation to generate the intersection entity of the equipment and the cabin in three-dimensional space, and assigns a temporary unique identifier to the intersection entity to associate it with the corresponding equipment-cabin combination; after the operation is completed, the plugin calls the CATIA volume calculation API, passes in the geometric feature objects of the intersection entity and the original equipment Part unit respectively, and executes the volume calculation method in sequence to obtain the intersection volume of the equipment and each candidate cabin. and the total volume of the equipment part unit itself .

8. The method for three-dimensional spatial association between equipment and cabin based on CATIA secondary development according to claim 7, characterized in that, In step S3, the specific steps for calculating and sorting the volume proportion are as follows: the plug-in retrieves all device-cabin combinations corresponding to the specified cache area. and The volume data is used to call the built-in preset calculation module to calculate the volume percentage of each device in each candidate compartment in turn. The formula is: The plugin then groups all volume percentage results for the same device according to the device identification code. Within each group, the percentage results are sorted in descending order from high to low. If there are cases with the same percentage value, the cabin identification code is used as the secondary sorting criterion. A structured volume percentage table is generated, which includes five fixed columns: device identification code, cabin identification code, intersection volume, total device volume, and volume percentage.

9. The method for three-dimensional spatial association between equipment and cabin based on CATIA secondary development according to claim 7, characterized in that, In step S4, the plugin calls CATIA's parametric design API, reads the volume ratio table in the cache area, matches the corresponding equipment Part unit according to the equipment identification code, and completes the parameter writing according to the correspondence between fields and data: the volume ratio data of the equipment and each compartment is written into the Volume-Ratio series fields of the corresponding equipment Part unit; the compartment name corresponding to the maximum volume ratio value of the same equipment in the volume ratio table is extracted and written into the Main-Comp field of the corresponding equipment Part unit. After all the specified data has been written, the plugin automatically generates a parameter write-back completion report. The report includes the equipment identification code, write-back field name, and write-back data content to record the parameter write-back result.