Engineering drawing custom labeling dynamic and static modification method based on 3DE secondary development
By monitoring user interaction events on the 3DE platform, blocking the original operator and displaying custom annotation tools and operators, the problem of incomplete annotation of the 3DE platform engineering diagram is solved, and dynamic and static modification of custom annotation is realized, improving user interaction efficiency and system stability.
Patent Information
- Application Number
- CN202510370314.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-27
AI Technical Summary
The 3DE platform only provides several general annotations in engineering drawing annotation, which cannot meet the specific requirements for drawing drawings, and the appearance of custom annotations cannot be modified dynamically and statically.
Through a method based on 3DE secondary development, the user's interaction events are monitored with the 3DE program, the 2D component original operator is blocked, the custom annotation context tool and operator are displayed, the temporary display appearance is constructed, and the custom annotation data and appearance are modified and reconstructed.
It realizes users to quickly enter the label editing state, enhances visualization and ease of use, supports dynamic and static modifications, meets the needs of multiple scenarios, and improves system stability and accuracy.
Smart Images

Figure CN120217477A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of 3D design and applications, and particularly relates to a method for dynamically and statically modifying custom annotations on engineering drawings based on 3DE secondary development. Background Art
[0002] 3DE, namely Dassault's 3D Experience collaborative design platform, is the mainstream 3D design collaborative platform in the water conservancy and hydropower industry, and has functions such as collaborative design, analysis and calculation, construction simulation, data management, etc. This system is based on a single data source system architecture, and uses a 3D visualization model as a carrier to realize real-time update, transfer, and utilization of design information.
[0003] The 3DE platform is at the world leading level in 3D modeling, especially in complex surface modeling. However, for engineering drawing output, especially for engineering drawing annotations, only several general annotations are provided, which cannot meet the requirements of engineering drawing output. By means of secondary development to customize annotations, the problem of incomplete engineering drawing annotations in 3DE can be improved.
[0004] In the 3DE platform, there are two ways to modify annotations: ① After selecting an annotation, some annotations will display context tools, and the appearance of the annotation is adjusted through the functions provided by the context tools. This is the static modification method; ② After selecting an annotation, an operator for controlling the appearance of the annotation will appear around the annotation, and the appearance of the annotation is adjusted by dragging the controller. This is the dynamic modification method.
[0005] However, since custom annotations are essentially 2D components, and 2D components only provide a dynamic adjustment method to modify the position and scale of 2D components, the appearance of custom annotations cannot be modified. Summary of the Invention
[0006] The present invention is proposed to solve the above deficiencies, and aims to provide a method for dynamically and statically modifying custom annotations on engineering drawings based on 3DE secondary development. This method realizes the method for dynamically and statically modifying custom annotations through secondary development.
[0007] To achieve the above objectives, the present invention adopts the following solutions:
[0008] A method for dynamically and statically modifying custom annotations on engineering drawings based on 3DE secondary development includes the following steps:
[0009] Step S1, monitor user selection: Start the window callback mode to monitor user interaction events with the 3DE program;
[0010] Step S2, mask the original operator of the 2D component: Removing the selected object from the CSO can clear the current selected object and mask the original operator of the 2D component;
[0011] Step S3: Display the custom annotation context tool, use the currently selected custom annotation as input to construct the context tool;
[0012] Step S4: Display the custom annotation operator, use the currently selected object as input to obtain custom annotation data, construct the operator and display it;
[0013] Step S5: Construct the temporary display shape of the custom annotation;
[0014] Step S6: Modify the custom annotation data;
[0015] Step S7: Reconstruct the shape of the custom annotation.
[0016] As a preferred implementation, in step S1, start the window callback mode to monitor user interaction events with the 3DE program; when the user left-clicks and right-clicks on the window object, the object will be selected. Just monitor the left-click event and the right-click event (Context).
[0017] As a preferred implementation, in step S1, when the object selected by the user is a custom annotation, enter step S2; otherwise, continue with step S1.
[0018] As a preferred implementation, in step S3, using the currently selected custom annotation as input, constructing the context tool includes the following steps:
[0019] Step S31: Obtain the key data of the custom annotation;
[0020] Step S32: According to the key data, construct the context toolbar window and layout the static function corresponding buttons in the window;
[0021] Step S32: Construct the button response method to handle the user's button click event;
[0022] Step S33: Obtain the current position of the mouse in the 3DE window, and set the upper left corner position of the context tool window to the new position;
[0023] Step S34: Call the SetVisibility() method of the context tool window to display it.
[0024] As a preferred implementation, in step S4, using the currently selected object as input, obtaining the custom annotation data, constructing the operator and displaying it includes the following steps:
[0025] Step S41: Obtain the key data of the custom annotation;
[0026] Step S42: Construct a custom annotation operator component. The operator component inherits from CATModelForRep2D and can accept user operations.
[0027] Step S43: Construct a custom annotation operator component shape object and set it to the operator component.
[0028] Step S43: Add the custom annotation operator to the ISO and update the display.
[0029] As a preferred embodiment, in step S5, when the user modifies the annotation by dragging the custom feature operator, a temporary display is constructed to express the current shape of the custom annotation in real time.
[0030] As a preferred embodiment, in step S5, constructing the temporary display shape of the custom annotation includes the following steps:
[0031] Step S51: Obtain the operator currently operated by the user and extract the key data saved in the operator.
[0032] Step S52: Obtain the current operator movement transformation matrix.
[0033] Step S53: Use the data obtained in steps S51 and S52 to calculate the current temporary shape of the custom annotation and construct a temporary display object.
[0034] Step S54: Calculate the transformation matrix of the view where the current custom annotation is located relative to the drawing.
[0035] Step S55: Change the position of the temporary display object constructed in step S53 according to the matrix obtained in step S54 to ensure the correct position of the temporary display object.
[0036] Step S56: Add the temporary display object to the current window and update the window display.
[0037] As a preferred embodiment, in step S6, modifying the custom annotation data is specifically as follows: when the dragging of the operator ends or the function of the context tool button is completed, the current custom annotation data is modified according to the rules and saved to the custom annotation.
[0038] As a preferred embodiment, in step S7, reconstructing the custom annotation shape is specifically by deleting all elements in the custom annotation, generating custom annotation shape elements according to the final annotation data, and updating the display of the annotation in the view.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] First, the method of the present invention improves the user interaction efficiency. By monitoring the interaction events between the user and the 3DE program, and automatically triggering the corresponding manipulators and context tools after selecting the custom annotation, the repetitive operations can be significantly reduced, enabling the user to quickly enter the annotation editing state; enhancing visualization and usability, defining exclusive custom annotation manipulators and context tools, allowing the user to operate the annotations in the engineering drawing through an intuitive interface and visualization components, thus reducing the dependence on the underlying system commands or scripts.
[0041] Second, the present invention can achieve allowing the user to view the changes in the annotation shape in real time during the operation (dynamic modification), and at the same time supports data persistence and shape reconstruction (static update) after the operation, meeting the usage requirements of multiple scenarios.
[0042] Third, the method of the present invention has strong applicability and scalability. By shielding the original 2D part manipulators and creating custom manipulators, the secondary development of the existing 3DE platform interfaces or APIs can be realized; more types of custom annotations and operation methods can be conveniently extended.
[0043] Fourth, the present invention improves the system stability and accuracy. Through monitoring and logical judgment, the annotation editing process only enters when the user truly selects the custom annotation, avoiding misoperations or misjudgments on other objects, and ensuring the safety and accuracy of the operation process.
[0044] Fifth, the present invention can quickly obtain and present key data. By obtaining the key data of the custom annotation, the editable or selectable content related to the current annotation can be automatically displayed in the context tool window, improving the editing efficiency.
[0045] Sixth, by inheriting the existing CATModelForRep2D mechanism, the present invention can be seamlessly integrated with the existing 3DE drawing environment and model visualization method, reducing the development workload, enhancing the system compatibility, constructing the shape object of the custom annotation manipulator component to distinguish it from the ordinary 2D manipulator, making it easier for the user to identify and edit.
[0046] In summary, the dynamic and static modification method of the engineering drawing custom annotation based on 3DE secondary development of the present invention has significant improvements and enhancements in terms of user interaction efficiency, dynamic visualization effect, system scalability, and data management consistency compared with the traditional annotation method. Such improvements can provide higher flexibility and convenience for users engaged in 3DE platform development and using the engineering drawing annotation function in their daily design and drawing work. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic flow chart of a method for dynamically and statically modifying the custom annotation of an engineering drawing based on 3DE secondary development of the present invention;
[0048] Figure 2 Schematic of the original operator for 2D components
[0049] Figure 3 Schematic when dynamically modifying custom annotations in the method of the present invention
[0050] Figure 4 Examples of context tools and annotation operators generated by using the method of the present invention Detailed implementation manners
[0051] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the protection scope of the present invention.
[0052] It should be understood that the accompanying drawings are only for illustrative purposes and cannot be construed as a limitation of this patent; for better illustration of this embodiment, some components in the accompanying drawings will be omitted, enlarged or reduced, which does not represent the size of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the accompanying drawings may be omitted. The positional relationships described in the accompanying drawings are only for illustrative purposes and cannot be construed as a limitation of this patent.
[0053] As Figure 1 shown, a method for dynamically and statically modifying custom annotations in engineering drawings based on 3DE secondary development of the present invention includes the following steps:
[0054] Step S1, monitor user selection. Start the window callback mode to monitor user interaction events with the 3DE program. When the user left-clicks or right-clicks on a window object, the object will be selected. Therefore, only the left-click event (Activate) and the right-click event (Context) need to be monitored. When the object selected by the user is a custom annotation, go to step S2; otherwise, continue with step S1.
[0055] Step S2, shield the original operator of the 2D component. Removing the selected object from the CSO can clear the current selected object, achieving the purpose of shielding the original operator of the 2D component. Figure 2 As shown in the original operator, this operator cannot meet the requirements for dynamically modifying custom annotations, so it is necessary to shield the original operator.
[0056] Step S3, display the context tool for custom annotations. Using the currently selected custom annotation as input, construct the context tool and display it at the upper right position of the mouse. The specific steps include:
[0057] Step S31, obtain the custom annotation key data;
[0058] Step S32, construct a context toolbar window (CATDlgDialog) based on the key data, and layout the static function corresponding buttons (CATDlgPushButton) in the window;
[0059] Step S32, construct a button response method to handle the user's button click event;
[0060] Step S33, obtain the current position (pos_x, pos_y) of the mouse in the 3DE window, and set the upper left corner position of the context tool window to the new position (pos_x + 36, pos_y - 72);
[0061] Step S34, call the SetVisibility() method of the context tool window to display it.
[0062] Step S4, display the custom annotation operator. Take the currently selected object as the input, obtain the custom annotation data, construct the operator as needed and display it. The specific steps include:
[0063] Step S41, obtain the custom annotation key data;
[0064] Step S42, construct a custom annotation operator component. The operator component inherits from CATModelForRep2D and can accept user operations;
[0065] Step S43, construct the shape object (CAT2DRep) of the custom annotation operator component, and set it to the operator component;
[0066] Step S43, add the custom annotation operator to the ISO and update the display.
[0067] Step S5, construct a temporary display shape for the custom annotation. When the user modifies the annotation by dragging the custom feature operator, to ensure the smoothness of the operation, a more efficient temporary display is constructed to express the current shape of the custom annotation in real time, Figure 3 as shown in the temporary display generated when dragging the upper edge of the following text up. The specific steps include:
[0068] Step S51, obtain the operator currently operated by the user, and extract the key data saved in the operator;
[0069] Step S52, obtain the current movement transformation matrix of the operator;
[0070] Step S53, use the data obtained in Steps S51 and S52 to calculate the current temporary shape of the custom annotation, and construct a temporary display object (CAT2DRep);
[0071] Step S54, calculate the transformation matrix of the view where the current custom annotation is located relative to the drawing.
[0072] Step S55, change the position of the temporary display object constructed in step S53 according to the matrix obtained in step S54 to ensure the correct position of the temporary display object.
[0073] Step S56, add the temporary display object to the current window and update the window display.
[0074] Step S6, modify the custom annotation data. When the drag operation is ended or the function of the context tool button is completed, modify the current custom annotation data according to the rules and save it to the custom annotation.
[0075] Step S7, reconstruct the shape of the custom annotation. Delete all elements in the custom annotation, generate the shape elements of the custom annotation according to the final annotation data, and update the display of the annotation in the view.
[0076] The above embodiments are only illustrative examples of the technical solutions of the present invention. The present invention is not limited to what is described in the above embodiments, but is subject to the scope defined by the claims. Any modification, supplement, or equivalent replacement made by those skilled in the art of the present invention based on this embodiment is within the scope protected by the claims of the present invention.
Claims
1. A method for dynamic and static modification of custom annotations of engineering drawings based on 3DE secondary development, characterized by: The steps include: Step S1, monitoring user selection: starting the window callback mode, monitoring the user's interaction events with the 3DE program; Step S2, shielding the original operator of the 2D component: removing the selected object from the CSO can clear the current selected object and shield the original operator of the 2D component; Step S3, displaying a custom annotation context tool, and constructing a context tool using the currently selected custom annotation as input; Step S4, displaying the custom annotation operator, taking the currently selected object as input, obtaining the custom annotation data, constructing the operator and displaying it; Step S5, constructing a temporary display shape of a custom annotation; Step S6, modifying the custom annotation data; Step S7, reconstructing the custom annotation shape.
2. The method for modifying dynamic and static self-defined annotations of engineering drawings based on 3DE secondary development according to claim 1 is characterized in that: In step S1, the window callback mode is started to monitor the user's interaction events with the 3DE program; when the user left-clicks and right-clicks the window object, the object will be selected, and the left-click event and the right-click event (Context) can be monitored.
3. The method for modifying dynamic and static self-defined annotations of engineering drawings based on 3DE secondary development according to claim 2 is characterized in that: In step S1, when the object selected by the user is a custom annotation, proceed to step S2; otherwise, continue to step S1.
4. The method for modifying dynamic and static custom annotations of engineering drawings based on 3DE secondary development according to claim 1, 2 or 3, characterized in that: In step S3, taking the currently selected custom annotation as input, constructing a context tool includes the following steps: Step S31, obtaining custom annotation key data; Step S32, constructing a context toolbar window according to the key data, and laying out buttons corresponding to the static functions in the window; Step S32, constructing a button response method to process the user clicking the button event; Step S33, obtaining the current position of the mouse in the 3DE window, and setting the position of the upper left corner of the context tool window to a new position; Step S34, calling the SetVisibility() method to display the context tool window.
5. The method for modifying dynamic and static user-defined annotations of engineering drawings based on 3DE secondary development according to claim 1, 2 or 3, characterized in that: In step S4, taking the currently selected object as input, obtaining the custom annotation data, constructing the operator and displaying it include the following steps: Step S41, obtaining custom annotation key data; Step S42, constructing a custom annotation operator component, the operator component inherits from CATModelForRep2D and can accept user operations; Step S43, constructing a custom annotation operator component outline object and setting it to the operator component; Step S43, adding the custom annotation operator to ISO and updating the display.
6. The method for modifying dynamic and static self-defined annotations of engineering drawings based on 3DE secondary development according to claim 5 is characterized in that: In step S5, when the user operates the custom feature operator by dragging to modify the annotation, a temporary display is constructed to express the current shape of the custom annotation in real time.
7. The method for modifying dynamic and static self-defined annotations of engineering drawings based on 3DE secondary development according to claim 6 is characterized in that: In step S5, constructing a temporary display shape of a custom annotation includes the following steps: Step S51, obtaining the operator currently operated by the user, and extracting key data stored in the operator; Step S52, obtaining the current operator movement change matrix; Step S53, using the data obtained in steps S51 and S52, calculate the temporary shape of the current custom annotation and construct a temporary display object; Step S54, calculating the change matrix of the view where the current custom annotation is located relative to the drawing; Step S55, changing the position of the temporary display object constructed in step S53 according to the matrix obtained in step S54, to ensure that the position of the temporary display object is correct; Step S56, adding the temporary display object to the current window and updating the window display.
8. The method for modifying dynamic and static user-defined annotations of engineering drawings based on 3DE secondary development according to claim 7 is characterized in that: In the step S6, modifying the custom annotation data specifically includes: when the dragging operator ends or the context tool button function is executed, modifying the current custom annotation data according to the rules and saving it in the custom annotation.
9. The method for modifying dynamic and static user-defined annotations of engineering drawings based on 3DE secondary development according to claim 8, characterized in that: In the step S7, the custom annotation outline is reconstructed by deleting all elements in the custom annotation, generating custom annotation outline elements according to the final annotation data, and updating the display of the annotation in the view.