Method, device and equipment for quickly deleting digital-analog assembly holes of parts and medium
By developing programs in CATIA, using assembly structure trees and global array variables, the automated selection and batch deletion of assembly holes are achieved, which solves the problems of time-consuming and easy-to-missing in the existing technology, and improves operational efficiency and design quality.
Patent Information
- Application Number
- CN202510564307.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-12
AI Technical Summary
In the prior art, CATIA needs to operate one by one when deleting assembly holes, which takes a long time and is easy to miss, resulting in cumbersome and inefficient design process.
By developing programs in CATIA, using assembly structure trees and global array variables, the assembly holes are automatically selected and deleted, avoiding repeated operations and omissions, and batch deletion is achieved using traversal search and feature processing technologies.
The operation process of batch deletion of assembly holes is simplified, efficiency is improved, errors are reduced, and design quality is improved.
Smart Images

Figure CN120470645A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of automobile design, and in particular to a method, device, equipment and medium for quickly deleting assembly holes of a digital model of a part. Background Art
[0002] Currently, Dassault's 3D design software CATIA is widely used in tooling design for automotive equipment integrators and surface design for automobiles and aircraft. During the automotive production design process, modifications to assembly parts or assembly methods often require the deletion of existing assembly holes.
[0003] With existing technology, CATIA's own function of deleting assembly holes requires double-clicking the part model to make the part editable. This step is easy to miss or repeat, and the feature editing window will be opened when the operation is repeated, which will cause unnecessary waste of time.
[0004] In addition, each time you select an assembly hole and press delete, you must confirm again in the "Delete" window. This step is unnecessary but consumes a lot of time.
[0005] Finally, when there are a large number of parts that need to delete assembly holes, the only way is to delete the assembly holes one by one. This process is tedious and time-consuming, and it is easy to cause omissions.
[0006] When there are a large number of parts that need to have assembly holes deleted, the process of deleting assembly holes in CATIA is tedious and time-consuming, and is prone to omissions. Summary of the Invention
[0007] In response to the above problems, the present disclosure provides a method, device, equipment and medium for quickly deleting assembly holes of a part digital model.
[0008] In a first aspect, a method for quickly deleting a digital model assembly hole of a part comprises:
[0009] When opening the assembly model, click the "Delete Assembly Hole" button to expand the assembly structure tree and enter the state where parts can be selected;
[0010] In the state where parts can be selected, by clicking a part node in the assembly structure tree or clicking a part model in the 3D model of the part to be selected, the path of the clicked part will be added to the parts list in the program window. The parts list in the program window is used to display the selected parts.
[0011] Select a part in the parts list of the program window. Click "Remove Selection" to remove the selected part from the parts list of the program window. Click "Remove All" to clear the parts list of the program window.
[0012] After clicking "OK", delete the assembly holes of the selected parts in the parts list of the program window;
[0013] Among them, a global array variable is used as the parts object list to store the selected parts objects; when selecting parts, first add the parts object to the parts object list, and then display the path of the part in the parts list of the program window; the parts object list and the parts list of the program window correspond to each other, and when one of them is added or deleted, the other is synchronized for addition or deletion.
[0014] Furthermore, when the user selects a part that has already been selected, it is not added repeatedly to the parts list of the program window.
[0015] Furthermore, in the state where parts can be selected, hold down Ctrl to select multiple parts at once.
[0016] Furthermore, the state where parts can be selected is a continuous state until clicking "OK" to exit the state where parts can be selected;
[0017] In the state where parts can be selected, the selection operation can be repeated.
[0018] Furthermore, deleting the assembly holes of the selected parts in the parts list of the program window includes:
[0019] Traverse the parts list of the program window and perform the following operations on each part therein:
[0020] Obtain the CATIDescendants interface of the part object; through the GetAllChildren() method of CATIDescendants, obtain a list of all features of the part;
[0021] Traverse all features of this part and perform the following operations on each feature:
[0022] Obtain the pointer object of the CATIAHole type of this feature through the QueryInterface() method, and judge whether the pointer of this CATIAHole type is null. If it is not null, this feature is a hole; if the pointer is null, skip this feature;
[0023] Obtain the CATIAlias interface of this feature; through the GetAlias() method of the CATIAlias interface, obtain the name of this feature, and judge whether the name of this feature starts with "JEE_hole". If it is, then determine that this hole is an assembly hole; if not, skip this feature;
[0024] Obtain the feature that aggregates this feature, that is, the aggregation feature, the owner of this feature.
[0025] Delete this feature from its aggregated features through the Remove() method of the aggregated feature.
[0026] Furthermore, the assembly holes of the selected parts in the parts list of the program window are deleted, and then:
[0027] Get the CATIMechanicalVisu interface of the assembly hole part to be deleted, and set the visualization status of the mechanical feature of the part to visible through the SetVisuStatus() method of the CATIMechanicalVisu interface;
[0028] Get the CATISpecObject interface of the assembly hole part to be deleted, and rebuild the part features through the Update() method of the CATISpecObject interface.
[0029] In a second aspect, a device for quickly deleting a digital mold assembly hole of a part comprises:
[0030] Enter delete cell, select cell, remove selected cell and delete cell;
[0031] Enter the deletion unit, which is used to expand the assembly structure tree by clicking the "Delete assembly hole" button and enter the state where parts can be selected;
[0032] The selection unit is used to add the path of the clicked part to the parts list in the program window by clicking the part node in the assembly structure tree or clicking the part model in the 3D model of the part to be selected when the part can be selected. The parts list in the program window is used to display the selected parts.
[0033] The Remove Selection unit is used to select parts in the parts list of the program window. When you click "Remove Selection", the selected parts will be removed from the parts list of the program window; when you click "Remove All", the parts list of the program window will be cleared.
[0034] Delete unit, used to delete the assembly hole of the selected part in the parts list in the program window after clicking "OK";
[0035] Among them, a global array variable is used as a part object list to store the selected part objects; when selecting a part, the part object is first added to the part object list, and then the path of the part is displayed in the part list of the program window; the part object list and the part list of the program window correspond to each other, and when one of them is added or deleted, the other is added or deleted synchronously.
[0036] Furthermore, when the user selects a part that has already been selected, it is not added to the program window parts list.
[0037] Further, in the state where parts can be selected, hold down the Ctrl key to select multiple parts at once.
[0038] Further, the state where parts can be selected is a continuous state until clicking "OK" to exit the state where parts can be selected;
[0039] In the state where parts can be selected, the selection operation can be repeated.
[0040] Further, the deletion unit is specifically used for:
[0041] Traverse the part list in the program window and perform the following operations on each part therein:
[0042] Obtain the CATIDescendants interface of the part object; through the GetAllChildren() method of CATIDescendants, obtain the list of all features of the part;
[0043] Traverse all features of this part and perform the following operations on each feature:
[0044] Obtain the pointer object of the CATIAHole type of this feature through the QueryInterface() method, and determine whether the pointer of this CATIAHole type is null. If it is not null, then this feature is a hole; if the pointer is null, then skip this feature;
[0045] Obtain the CATIAlias interface of this feature; through the GetAlias() method of the CATIAlias interface, obtain the name of this feature, and determine whether the name of this feature starts with "JEE_hole". If it does, then determine that this hole is an assembly hole; if not, then skip this feature;
[0046] Obtain the feature that aggregates this feature, that is, the aggregation feature, the owner of this feature.
[0047] Delete this feature from its aggregation feature through the Remove() method of the aggregation feature.
[0048] Further, the deletion unit is also specifically used for:
[0049] Obtain the CATIMechanicalVisu interface of the part with the assembly hole to be deleted, and set the visualization state of the mechanical features of the part to visible through the SetVisuStatus() method of the CATIMechanicalVisu interface;
[0050] Obtain the CATISpecObject interface of the part with the assembly hole to be deleted, and reconstruct the part features through the Update() method of the CATISpecObject interface.
[0051] According to a third aspect, an electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0052] a memory storing a computer program;
[0053] The processor is used to implement the above-mentioned method of quickly deleting the assembly holes of the digital model of the part when executing the computer program stored in the memory.
[0054] In a fourth aspect, a computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for quickly deleting a part digital model assembly hole.
[0055] The present disclosure includes at least the following beneficial effects:
[0056] The disclosed method is simple to operate and has clear results. It effectively utilizes the secondary development API of CATIA to realize the function of quickly deleting assembly holes of parts in batches in CATIA.
[0057] The program automatically deletes part assembly holes, avoiding some unnecessary operations when manually deleting part assembly holes, such as double-clicking the part to enter the editing state, and confirming the operation in the window when deleting assembly holes. This greatly simplifies the operation process of batch deleting part assembly holes and improves operational efficiency.
[0058] By using the program to traverse and retrieve assembly holes, omissions that may occur when manually deleting part assembly holes can be avoided, errors can be reduced, and design quality can be effectively improved.
[0059] Other features and advantages of the present disclosure will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be achieved and obtained through the structures indicated in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0061] Figure 1 This is a schematic diagram of the method flow of an embodiment of the present disclosure;
[0062] Figure 2 This is a schematic diagram of the principle of the method of the embodiment of the present disclosure;
[0063] Figure 3 A schematic diagram of toolbar icons and program operations according to an embodiment of the present disclosure;
[0064] Figure 4 This is a schematic diagram of a program window according to an embodiment of the present disclosure;
[0065] Figure 5 This is a schematic diagram of the structure of the device according to the embodiment of the present disclosure;
[0066] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0067] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0068] like Figure 1 As shown, a method for quickly deleting a digital model assembly hole of a part, the method comprising:
[0069] S101, when opening the assembly digital model, click the "Delete Assembly Hole" button to expand the assembly structure tree and enter the state where parts can be selected;
[0070] S102, in a state where a part can be selected, by clicking a part node in the assembly structure tree or clicking a part model in the 3D model of the part to be selected, the path of the clicked part is added to the parts list in the program window, and the parts list in the program window is used to display the selected parts;
[0071] S103, selecting a part in the parts list of the program window, and clicking "Remove Selection" to remove the selected part from the parts list of the program window; and clicking "Remove All" to clear the parts list of the program window;
[0072] S104, after clicking "OK", the assembly holes of the selected parts in the parts list of the program window are deleted;
[0073] Among them, a global array variable is used as a part object list to store the selected part objects; when selecting a part, the part object is first added to the part object list, and then the path of the part is displayed in the part list of the program window; the part object list and the part list of the program window correspond to each other, and when one of them is added or deleted, the other is added or deleted synchronously.
[0074] The specific implementation is as follows:
[0075] like Figure 2 As shown, based on Catia secondary development, the user manually selects the parts whose assembly holes need to be deleted:
[0076] Open the assembly digital model in CATIA;
[0077] Click the "Delete Assembly Hole" tool on the toolbar;
[0078] Select the parts whose assembly holes need to be deleted. You can select multiple parts.
[0079] Click OK.
[0080] When selecting parts whose assembly holes need to be deleted, hold down Ctrl to select multiple parts at once, or repeat the selection process after selecting a part. The selected parts will appear in the parts list in the dialog box. You can select a part in the parts list and right-click to delete it, or you can simply right-click to clear the parts list. After clicking "OK," the program will delete all assembly holes for all parts in the parts list and automatically exit.
[0081] like Figure 3 As shown, the program opens with parts ready for selection. Simply click a part node in the assembly structure tree, or directly click the part model in the 3D model, to add the path to the part in the program window's parts list. You can hold down the Ctrl key to select multiple parts at once, or repeat the selection process multiple times. Parts that have already been selected will not be added to the program window's parts list.
[0082] like Figure 4 As shown, if the user makes a mistake in selecting a part, he can select the part in the parts list in the program window, right-click to expand the menu, and click "Remove Selection" to remove it from the parts list. Clicking "Remove All" will clear the parts list.
[0083] The program uses a global array variable as a part object list to store the part objects selected by the user. When the user selects a part, the program first adds the part object to this part object list and then displays the part path in the part list in the program window. These two lists correspond to each other, and when one is added or deleted, the other is also added or deleted synchronously, thus completing the data binding with the view.
[0084] The user clicks "OK" to quickly delete the assembly holes of the selected parts.
[0085] When the user clicks "OK", the program iterates through the list of parts selected by the user and performs the following operations on each part:
[0086] 1. Obtain the CATIDescendants interface of the part object.
[0087] 2. Use the GetAllChildren() method of CATIDescendants to obtain a list of all features of the part. Traverse this part feature list and perform the following operations on each feature:
[0088] 1) Use the QueryInterface() method to obtain a pointer object of the CATIAHole type for this feature.
[0089] 2) Determine whether the pointer of the CATIAHole type is null. If it is not null, then this feature is a hole; if the pointer is null, then skip this feature.
[0090] 3) Obtain the CATIAlias interface of this feature.
[0091] 4) Use the GetAlias() method of the CATIAlias interface to obtain the name of this feature.
[0092] 5) Determine whether the name of this feature starts with "JEE_Hole". If it does, then determine that this hole is an assembly hole; if not, then skip this feature.
[0093] The name of the assembly hole for the test item used in this step is "JEE_Hole*". If it is different, it can be modified or this step can be directly skipped. When this step is skipped, the program will directly delete all holes under the part.
[0094] 6) Obtain the feature that aggregates this feature (aggregation feature), that is, the owner of this feature.
[0095] 7) Use the Remove() method of the aggregation feature to delete this feature from its aggregation feature.
[0096] 3. Obtain the CATIMechanicalVisu interface of the part.
[0097] 4. Use the SetVisuStatus() method of the CATIMechanicalVisu interface to set the visualization status of the part's mechanical features to visible.
[0098] 5. Obtain the CATISpecObject interface of the part.
[0099] 6. Use the Update() method of the CATISpecObject interface to rebuild the part features.
[0100] When the user clicks "OK", after the program completes the operation of the previous step, the program will automatically exit.
[0101] like Figure 5 As shown, a device for quickly deleting assembly holes of a part digital model comprises:
[0102] Enter the deletion unit 501, the selection unit 502, the removal selection unit 503 and the deletion unit 504;
[0103] Entering the deletion unit 501, for expanding the assembly structure tree and entering a state where parts can be selected by clicking the "Delete Assembly Hole" button;
[0104] The selection unit 502 is used to add the path of the clicked part to the parts list of the program window by clicking a part node in the assembly structure tree or clicking a part model in the 3D model of the part to be selected when the part is available for selection. The parts list of the program window is used to display the selected parts.
[0105] The removal selection unit 503 is used to select a part in the parts list of the program window. When "Remove Selection" is clicked, the selected part is removed from the parts list of the program window; when "Remove All" is clicked, the parts list of the program window is cleared;
[0106] The deletion unit 503 is used to delete the assembly holes of the selected parts in the parts list of the program window after clicking "OK";
[0107] Among them, a global array variable is used as a part object list to store the selected part objects; when selecting a part, the part object is first added to the part object list, and then the path of the part is displayed in the part list of the program window; the part object list and the part list of the program window correspond to each other, and when one of them is added or deleted, the other is added or deleted synchronously.
[0108] like Figure 6 As shown, the present disclosure provides an electronic device, including a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602 and the memory 603 communicate with each other through the communication bus 604;
[0109] Memory 603, storing computer programs;
[0110] The processor 601 is configured to implement the above method when executing the computer program stored in the memory 603 .
[0111] The present disclosure provides a computer-readable storage medium storing a computer program, which implements the above method when executed by a processor.
[0112] The computer-readable storage medium may be included in the device / apparatus described in the above embodiments, or may exist independently without being incorporated into the device / apparatus. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present disclosure.
[0113] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as, but not limited to, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0114] Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A method for quickly deleting a part digital model assembly hole, characterized in that: The method includes: When opening the assembly digital model, click the "Delete Assembly Hole" button to expand the assembly structure tree and enter the state where parts can be selected; In the state where parts can be selected, click on the part node in the assembly structure tree or click on the part digital model in the 3D digital model of the part to be selected, and add the path of the clicked part to the part list in the program window. The part list in the program window is used to display the selected parts; Select a part in the part list in the program window. When clicking "Remove Selection", the selected part is removed from the part list in the program window; when clicking "Remove All", the part list in the program window is cleared; After clicking "OK", delete the assembly holes of the selected parts in the part list in the program window; Among them, a global array variable is used as a part object list to store the selected part objects; when selecting a part, first add the part object to the part object list, and then display the path of the part in the part list in the program window; the part object list and the part list in the program window correspond to each other, and when one of them is added or deleted, the other is synchronized for addition or deletion.
2. A method for quickly deleting assembly holes of a part digital model according to claim 1, wherein When the user selects a part that has already been selected, it is not added to the part list in the program window repeatedly.
3. A method for quickly deleting assembly holes of a part digital model according to claim 1, wherein In the state where parts can be selected, hold down Ctrl to select multiple parts at once.
4. A method for quickly deleting assembly holes of a part digital model according to claim 1, wherein The state where parts can be selected is a continuous state until clicking "OK" to exit the state where parts can be selected; In the state where parts can be selected, the selection operation can be repeated.
5. A method for quickly deleting assembly holes of a part digital model according to claim 1, wherein Deleting the assembly holes of the selected parts in the part list in the program window includes: Traverse the part list in the program window and perform the following operations on each part therein: Obtain the CATIDescendants interface of the part object; through the GetAllChildren() method of CATIDescendants, obtain the list of all features of the part; Traverse all the features of this part and perform the following operations on each feature: Obtain the pointer object of the CATIAHole type of this feature through the QueryInterface() method, and judge whether the pointer of this CATIAHole type is null. If it is not null, this feature is a hole; if the pointer is null, skip this feature; Obtain the CATIAlias interface of this feature; through the GetAlias() method of the CATIAlias interface, obtain the name of this feature, and judge whether the name of this feature starts with "JEE_Hole". If it is, then determine that this hole is an assembly hole; if not, skip this feature; Obtain the feature that aggregates this feature, that is, the aggregation feature, the owner of this feature; Delete this feature from its aggregated features through the Remove() method of the aggregated feature.
6. A method for quickly deleting a component digital mold assembly hole according to claim 5, characterized in that: Delete the assembly holes of the parts selected in the parts list of the program window, and also include: Get the CATIMechanicalVisu interface of the assembly hole part to be deleted, and set the visualization status of the mechanical feature of the part to visible through the SetVisuStatus() method of the CATIMechanicalVisu interface; Get the CATISpecObject interface of the assembly hole part to be deleted, and rebuild the part features through the Update() method of the CATISpecObject interface.
7. A device for quickly deleting assembly holes of parts, characterized in that: include: Enter delete cell, select cell, remove selected cell and delete cell; Enter the deletion unit, which is used to expand the assembly structure tree by clicking the "Delete assembly hole" button and enter the state where parts can be selected; The selection unit is used to add the path of the clicked part to the parts list in the program window by clicking the part node in the assembly structure tree or clicking the part model in the 3D model of the part to be selected when the part can be selected. The parts list in the program window is used to display the selected parts. The Remove Selection unit is used to select a part in the parts list of the program window. When you click "Remove Selection", the selected part is removed from the parts list of the program window; when you click "Remove All", the parts list of the program window is cleared. Delete unit, used to delete the assembly hole of the part selected in the parts list in the program window after clicking "OK"; Among them, a global array variable is used as a part object list to store the selected part objects; when selecting a part, the part object is first added to the part object list, and then the path of the part is displayed in the part list of the program window; the part object list and the part list of the program window correspond to each other, and when one of them is added or deleted, the other is added or deleted synchronously.
8. The device for quickly deleting assembly holes of a part model according to claim 7, characterized in that: When the user selects a part that has already been selected, it will not be added to the program window parts list.
9. The device for quickly deleting assembly holes of a part model according to claim 7, characterized in that: When parts can be selected, press and hold Ctrl to select multiple parts at once.
10. The device for quickly deleting assembly holes of a part digital model according to claim 7, characterized in that: The state of being able to select parts is a continuous state until you click "OK" to exit the state of being able to select parts; When parts can be selected, the selection operation can be repeated.
11. The device for quickly deleting assembly holes of a part digital model according to claim 7, characterized in that: Delete unit, specifically used for: Traverse the parts list in the program window and perform the following operations on each part: Obtain the CATIDescendants interface of the part object; through the GetAllChildren() method of CATIDescendants, obtain the list of all features of the part; Traverse all the features of this part and perform the following operations on each feature: Obtain a pointer object of the CATIAHole type of this feature through the QueryInterface() method, and determine whether the pointer of this CATIAHole type is null. If it is not null, then this feature is a hole; If the pointer is null, skip this feature; Obtain the CATIAlias interface of this feature; obtain the name of this feature through the GetAlias() method of the CATIAlias interface, and determine whether the name of this feature starts with "JEE_hole". If it does, then determine this hole as an assembly hole. If not, skip this feature; Obtain the feature that aggregates this feature, that is, the aggregation feature, the owner of this feature; Delete this feature from its aggregation feature through the Remove() method of the aggregation feature.
12. A device for quickly deleting assembly holes in a part digital model according to claim 11, characterized in that The deletion unit is specifically further used for: Obtain the CATIMechanicalVisu interface of the part with assembly holes to be deleted, and set the visualization status of the mechanical features of the part to visible through the SetVisuStatus() method of the CATIMechanicalVisu interface; Obtain the CATISpecObject interface of the part with assembly holes to be deleted, and reconstruct the part features through the Update() method of the CATISpecObject interface.
13. An electronic device, characterized in that: It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus; The memory stores a computer program; The processor is used to implement a method for quickly deleting assembly holes in a part digital model according to any one of claims 1-6 when executing the computer program stored on the memory.
14. A computer-readable storage medium storing a computer program, characterized in that: The computer program realizes a method for quickly deleting assembly holes in a part digital model according to any one of claims 1-6 when executed by the processor.