A method for automatically batch adding numbering to process flowcharts

CN115455907BActive Publication Date: 2026-10-09NUCLEAR IND ENG RES & DESIGN CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211278537.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-19
Publication Date
2026-10-09
Estimated Expiration
2042-10-19

AI Technical Summary

Technical Problem

[0005]但是,在工艺设计过程中,根据工艺需求,可能需要向现有流程图中增加或删除设备、管线,相应的编号就需要打乱重新编号,效率非常低下,而且容易造成编号重复或者漏写、不连续等后果

Benefits of technology

[0021]This invention provides a method for automatically adding numbers in batches to a process flow diagram. The method includes calling the AddText method in the VBA object model based on preset information to automatically insert preset text into the flow diagram. The preset information includes the insertion point, text content, and text height. The insertion point determines the position of the number; the text content displays the number of each numbered component; and each numbered component has a different number. This invention ensures the continuity of the numbering, and only requires simple parameter settings in the VBA object model's tool interface to automatically add multiple numbers in a short time. This invention has strong practicality in process flow drawing in the engineering design industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115455907B_ABST
    Figure CN115455907B_ABST
Patent Text Reader

Abstract

The application provides a method for automatically adding numbers in a process flowchart, comprising calling an AddText method in a VBA object model according to preset information to automatically insert preset text in the flowchart; the preset information comprises an insertion point, text content and text height; the insertion point is used for determining the position of the number; the text content is used for displaying the number of each numbered component; the numbers of the numbered components are different. The application guarantees the continuity of the numbers, and only needs to make simple parameter setting in a tool interface of the VBA object model, so that multiple numbers can be automatically added in a short time. The application has strong practicability in process flow drawing in the engineering design industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of process data processing technology, and in particular to a method for automatically adding numbers in batches to a process flow diagram. Background Technology

[0002] A piping and instrumentation diagram (PID diagram) uses standardized graphic symbols and text codes to visually connect all equipment, instruments, pipes, valves, and fittings used in a process flow according to their respective functions and process requirements. This serves to describe the structure and function of the process unit. The PID diagram is developed based on process design and is a crucial part of engineering design, serving as the primary basis for the work of various disciplines within the engineering design process.

[0003] PID diagrams are typically created using professional CAD software. The general process involves first drawing the main equipment, instruments, and valves, placing them in the flow chart according to their size and position, then connecting these elements with pipelines. Finally, all elements in the PID diagram are numbered. The numbers for equipment and valves are usually called "tag numbers," and the numbers for pipelines are called "pipeline numbers." The purpose of numbering is to generate data tables such as equipment lists and pipeline characteristic tables.

[0004] like Figure 1 As shown, V101 is the equipment tag number, V0105 and V0207 are valve tag numbers, and PL1006 is the pipeline tag number. Currently, the main method for adding tag numbers to process flow diagrams is to manually add text, and the position and content of the text must be determined by human judgment. Generally, the tag numbers of similar components are consecutive. Assuming there are multiple storage tanks in a diagram, the tag numbers should be V101, V102, V103, and so on.

[0005] However, during the process design process, depending on the process requirements, it may be necessary to add or delete equipment and pipelines in the existing flow chart. The corresponding numbers need to be shuffled and renumbered, which is very inefficient and can easily lead to consequences such as duplicate or missing numbers, or discontinuity.

[0006] Currently, in the process of drawing the process flow diagram, the number of each piece of equipment, valve, and pipeline is manually edited and added one by one. If equipment or pipelines are added or removed later, the workload of readjusting the numbering is huge, time-consuming and labor-intensive. Summary of the Invention

[0007] In order to overcome the shortcomings of the prior art, the purpose of this invention is to provide a method for automatically adding numbers in batches to a process flow diagram.

[0008] To achieve the above objectives, the present invention provides the following solution:

[0009] A method for automatically adding numbers in batches to a process flow diagram includes:

[0010] The AddText method in the VBA object model is called based on preset information to automatically insert preset text into the flowchart; the preset information includes the insertion point, text content, and text height; the insertion point is used to determine the position of the number; the text content is used to display the number of each numbered component; the numbers of each numbered component are different.

[0011] Preferably, before calling the AddText method in the VBA object model based on preset information to automatically insert preset text into the flowchart, the method further includes:

[0012] Extract all layer names and text style names from the current drawing;

[0013] The attributes of the text content are determined based on the layer name and the text style name.

[0014] Preferably, the automatic insertion of preset text into the flowchart includes:

[0015] Use the GetBoundingBox method to obtain the coordinates of the bottom left corner and top right corner of the rectangle containing the numbered component;

[0016] The position of the insertion point is determined by calculating the coordinates of the lower left corner and the upper right corner, so that the text content appears in the middle of the numbered component.

[0017] Preferably, before calling the AddText method in the VBA object model based on preset information to automatically insert preset text into the flowchart, the method further includes:

[0018] Extract the text template from the current drawing;

[0019] The input format of the text content is determined based on the text template.

[0020] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0021] This invention provides a method for automatically adding numbers in batches to a process flow diagram. The method includes calling the AddText method in the VBA object model based on preset information to automatically insert preset text into the flow diagram. The preset information includes the insertion point, text content, and text height. The insertion point determines the position of the number; the text content displays the number of each numbered component; and each numbered component has a different number. This invention ensures the continuity of the numbering, and only requires simple parameter settings in the VBA object model's tool interface to automatically add multiple numbers in a short time. This invention has strong practicality in process flow drawing in the engineering design industry. Attached Figure Description

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

[0023] Figure 1 A partial schematic diagram of the process flow provided for existing technologies;

[0024] Figure 2 A flowchart of the method provided in an embodiment of the present invention;

[0025] Figure 3 A schematic diagram of a VBA manager provided in an embodiment of the present invention;

[0026] Figure 4 This is a schematic diagram of a custom menu provided in an embodiment of the present invention;

[0027] Figure 5 A schematic diagram of a cascading menu system provided in an embodiment of the present invention;

[0028] Figure 6 A schematic diagram of the user interface provided for an embodiment of the present invention;

[0029] Figure 7 The diagram below shows the numbers provided for embodiments of the present invention;

[0030] Figure 8 A schematic diagram with numbers on the right provided for embodiments of the present invention;

[0031] Figure 9 This is a schematic diagram of the number rotation display provided in an embodiment of the present invention;

[0032] Figure 10 This is a schematic diagram of a layer list provided in an embodiment of the present invention;

[0033] Figure 11 This is a schematic diagram of a text style list provided in an embodiment of the present invention;

[0034] Figure 12 A partial schematic diagram of a process, not yet numbered, provided for an embodiment of the present invention;

[0035] Figure 13 This is a schematic diagram of a CAD plug-in menu system provided in an embodiment of the present invention;

[0036] Figure 14 This is a schematic diagram of a user options interface provided in an embodiment of the present invention;

[0037] Figure 15 This is a schematic diagram illustrating the effect of adding pipeline numbers according to an embodiment of the present invention;

[0038] Figure 16 This is a schematic diagram illustrating the effect of adding valve numbers according to an embodiment of the present invention. Detailed Implementation

[0039] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0040] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0041] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, including a series of steps, processes, methods, etc., is not limited to the steps listed, but may optionally include steps not listed, or may optionally include other steps inherent to these processes, methods, products, or devices.

[0042] The purpose of this invention is to provide a method for automatically adding numbers in batches to a process flow diagram, which ensures the continuity of the numbers and only requires simple parameter settings in the VBA object model tool interface to automatically add multiple numbers in a short time.

[0043] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0044] Figure 2 The method flowchart provided in the embodiments of the present invention is as follows: Figure 2 As shown, the present invention provides a method for automatically adding numbers in batches to a process flow diagram, comprising:

[0045] Step 100: Call the AddText method in the VBA object model according to the preset information to automatically insert preset text into the flowchart; the preset information includes the insertion point, text content, and text height; the insertion point is used to determine the position of the number; the text content is used to display the number of each numbered component; the numbers of each numbered component are different.

[0046] This invention first requires loading its functionality. This invention utilizes one function of a CAD plugin developed using the VBA language. In the CAD interface, enter the command `vbaload`, and select the Project98.zvb file in the dialog box. Then, enter the command `vbaman` to open the VBA manager, as shown below. Figure 3 As shown, the project is in a loading state. And, as... Figure 4 As shown, the plugin's menu automatically appears in the CAD interface.

[0047] Preferably, before calling the AddText method in the VBA object model based on preset information to automatically insert preset text into the flowchart, the method further includes:

[0048] Extract all layer names and text style names from the current drawing;

[0049] The attributes of the text content are determined based on the layer name and the text style name.

[0050] Preferably, the automatic insertion of preset text into the flowchart includes:

[0051] Use the GetBoundingBox method to obtain the coordinates of the bottom left corner and top right corner of the rectangle containing the numbered component;

[0052] The position of the insertion point is determined by calculating the coordinates of the lower left corner and the upper right corner, so that the text content appears in the middle of the numbered component.

[0053] Preferably, before calling the AddText method in the VBA object model based on preset information to automatically insert preset text into the flowchart, the method further includes:

[0054] Extract the text template from the current drawing;

[0055] The input format of the text content is determined based on the text template.

[0056] This invention is implemented using a CAD plugin written in VBA. Its technical principle is to automatically insert text into the flowchart by calling the AddText method in the VBA object model.

[0057] The function `AddText(TextString As String, InsertionPoint, Height As Double) As AcadText` requires three parameters: insertion point, text content, and text height. The insertion point determines the position of the number, typically appearing near the top, bottom, left, or right side of the numbered component. Whether the text is rotated also needs to be considered. The position of the numbered component is obtained using the `GetBoundingBox` method: `SubGetBoundingBox(MinPoint, MaxPoint)`. `MinPoint` is the coordinate of the bottom left corner of the rectangle containing the component, and `MaxPoint` is the coordinate of the top right corner. Calculations based on these two points ensure the numbered text appears in the center of the component. The text content requires a pre-selected text template. If the text template is `V1#` and the starting number is 7, the batch numbers will be `V107`, `V108`, etc. If the text template is `PL#-H1E` and the starting number is 3, the batch numbers will be `PL03-H1E`, `PL04-H1E`, etc. In addition, it is necessary to design the layer, text style and other attributes of the text used for numbering. All layer names and text style names in the current drawing can be extracted in advance for users to select and customize flexibly.

[0058] Specifically, such as Figure 5 As shown in the figure, after the function is loaded, click the menu "Drawing Assistant", "Quick Modification" and "Batch Text" in sequence to pop up a user window for adding text in the CAD drawing interface.

[0059] The design scheme of this invention utilizes a window interface developed using VBA's UserForm to interact with the user. The main features include options such as text addition position, text direction, text content, and text style. Figure 6 As shown.

[0060] Furthermore, users can choose whether the text is displayed above, below, to the left, or to the right of the device or pipeline, or they can check the "Automatic" option. If "Automatic" is checked, for flat devices, the number will be displayed below the device, such as... Figure 7 As shown. For slender equipment or vertical pipelines, the number is automatically displayed on the right, such as... Figure 8 As shown.

[0061] Furthermore, users can also choose the text direction. If "Auto" is selected, the text will be displayed horizontally for numbers shown above or below the device. For text shown on the left or right sides of the device, the text will be displayed vertically, such as... Figure 9 As shown.

[0062] Furthermore, the text template is a predefined line of text, where the # symbol is automatically replaced with a number value. Assuming the text template is... And if the starting value is set to 3, then the generated consecutive numbers are: wait.

[0063] Specifically, layers are an attribute that all graphic elements in a CAD drawing must possess. The plugin described in this invention pre-displays all layers of the current drawing in a combo box, such as... Figure 10 As shown. When a user selects a layer, that layer will be automatically used as the layer for adding numbers in batches.

[0064] Furthermore, text style is an attribute possessed by all text or multi-line text in CAD, defining the text's name and other content. The plugin described in this invention pre-displays all text styles of the current drawing in a combo box, such as... Figure 11 As shown. When a user selects a text style, that style will be automatically used as the numbering style when adding numbers in batches.

[0065] The following is a specific drawing example to illustrate the usage of the plug-in described in this invention. Suppose a portion of a process flow diagram has 5 pipelines and 5 manual valves, which are currently unnumbered. Figure 12 As shown. In the CAD drawing software's menu system, select "Drafting Assistant," "Quick Modification," and "Batch Text," as shown. Figure 13 As shown, a "Batch Add Text" user window pops up, as follows. Figure 14 As shown. First, add numbers to the pipelines, as follows:

[0066] Text template:

[0067] Starting value: 1

[0068] Layers: 0

[0069] Style: Fangsong font

[0070] Height: 3.5

[0071] First, select 5 pipelines with your mouse, then click the "Add in Batch" button. You will then see the corresponding numbers automatically appear below the pipelines, such as... Figure 15 As shown.

[0072] Then add a number to the valve and set it as follows:

[0073] Text addition location: Top

[0074] Text template: V#

[0075] Starting value: 1

[0076] Layers: 0

[0077] Style: Fangsong font

[0078] Height: 3.5

[0079] First, select 5 valves with the mouse, then click the "Batch Add" button. You will then see the corresponding numbers automatically appear above the valves, such as... Figure 16 As shown.

[0080] The beneficial effects of this invention are as follows:

[0081] (1) Good compatibility: This invention is developed based on CAD VBA language, and the automatically added numbered text is also a standard CAD primitive, which is fully compatible with hand-drawn.

[0082] (2) High degree of automation: This invention automatically adds corresponding numbered text to the selected equipment and pipelines, and the operation effect can be as desired.

[0083] (3) Abundant options: From the user's perspective, this invention provides multiple options such as text addition position, text direction, text template, layer, and text style through a window interface to meet various process design scenarios.

[0084] (4) Easy to operate: Users only need to select the equipment or pipeline to be numbered in advance, and click the mouse once in the window of this invention to add the number.

[0085] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0086] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for automatically adding numbers in batches to a process flow diagram, characterized in that, include: The AddText method in the VBA object model is called based on preset information to automatically insert preset text into the flowchart; the preset information includes the insertion point, text content, and text height; the insertion point is used to determine the position of the number. The text content is used to display the number of each numbered component; Each of the numbered components has a different number; The automatic insertion of preset text into the flowchart includes: Use the GetBoundingBox method to obtain the coordinates of the bottom left corner and top right corner of the rectangle containing the numbered component; The position of the insertion point is determined by calculating the coordinates of the lower left corner and the upper right corner, so that the text content appears in the middle of the numbered component. When automatically inserting preset text into a flowchart, the display position and direction of the text content are automatically determined according to the shape of the numbered component; wherein, the display position includes above, below, left, or right of the device or pipeline; when automatically determining the display position, for flat devices, the number is displayed below the device, and for slender devices or vertical pipelines, the number is displayed to the right; when automatically determining the text direction, for numbers displayed above or below the device, a horizontal display method is used, and for numbers displayed on the left or right sides of the device, a vertical display method is used.

2. The method for automatically adding numbers in batches to a process flow diagram according to claim 1, characterized in that, Before calling the AddText method in the VBA object model based on preset information to automatically insert preset text into the flowchart, the following steps are also included: Extract all layer names and text style names from the current drawing; The attributes of the text content are determined based on the layer name and the text style name.

3. The method for automatically adding numbers in batches to a process flow diagram according to claim 1, characterized in that, Before calling the AddText method in the VBA object model based on preset information to automatically insert preset text into the flowchart, the following steps are also included: Extract the text template from the current drawing; The input format of the text content is determined based on the text template.

Citation Information

Patent Citations

  • Interactive computer-aided design (CAD) engineering drawing batch processing method

    CN102495753A

  • Method for automatically generating instrument arrangement diagram by utilizing PDMS data source

    CN106202646A