Method and system for generating design template library based on Grasshopper

The Grasshopper plug-in automatically generates a substation secondary system design template library in the Rhinoceros software, which solves the problems of omissions and low efficiency during the data association modification process, realizes the automation and intuitive display of drawing updates, and significantly improves design efficiency.

CN115081048BActive Publication Date: 2024-09-24STATE GRID ZHEJIANG ELECTRIC POWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210268196.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-18
Publication Date
2024-09-24
Estimated Expiration
2042-03-18

AI Technical Summary

Technical Problem

In the design of substation secondary systems, due to complex correlations between data and omissions or inconsistencies often occur during the modification process, construction and operation and maintenance are affected. The existing technology relies on manual writing of Excel templates, which is cumbersome and inefficient.

Method used

The Grasshopper plug-in is used to automatically generate a design template library in the Rhinoceros software. By reading the properties of graphics and text blocks, the corresponding relationship between graphics and text is automatically generated to achieve automatic association and updating of data and drawings.

Benefits of technology

It realizes the automation of drawing updates, significantly saves manual preparation time and costs, improves design efficiency, intuitively displays data and drawing information, and makes operation results more intuitive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115081048B
    Figure CN115081048B
Patent Text Reader

Abstract

The present invention provides a method and system for generating a design template library based on Grasshopper, including opening a typical design drawing; selecting a combination of system elements for which a template needs to be made by using a selection command; developing a processing module program for copying graphics and text blocks; converting the read original graphics into line segments; obtaining the endpoints of all line segments obtained by graphics processing; obtaining the lower left corner boundary point of the selected graphics; automatically generating a battery block for redrawing the graphics on a canvas; reading the properties of the selected text annotation in the copy graphics module; automatically connecting panels with the same text; developing paired battery blocks, automatically associating paired TX and RX panels; and automatically combining all automatically generated battery blocks. The present invention allows a computer to automatically compile a template for updating a drawing in a one-click generation manner, and the graphics and annotation information on the drawing can be intuitively displayed in the template, and the data in the template corresponds one to one with the design elements on the drawing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of substation secondary system schematic design, and in particular to a Grasshopper-based design template library generation method and system, and in particular to Grasshopper-based rapid design template library generation. Background Art

[0002] The schematic design of the secondary system of the substation generally uses popular CAD software for drawing and annotation. At present, since the State Grid companies are promoting typical design templates in the secondary design process, and referring to the engineering configuration practices of international companies such as ABB, they are promoting the "nine unification" system in equipment selection, maintaining uniformity in nine aspects: functional configuration, setting format, report output, interface standard, screen grouping method, circuit design, panel display, device menu and information specification. In this context, substations of different voltage levels generally use typical construction drawing designs as reference designs for new design projects.

[0003] When designing a new substation secondary system, designers modify the typical reference design based on the personalized requirements of the new station and the different equipment manufacturers to form a design plan for the new station. In the above modification process based on the reference design, due to the rich associations between the data in the secondary design, especially the same data may be scattered on different drawings, or there are strong data associations between the data on the same drawing, such as between the terminal TX for sending data and the terminal RX for receiving data. However, in actual work, due to heavy tasks, tight time, and the fact that the design process is often interrupted by communication with the construction site, omissions, inconsistencies, or even errors often occur when modifying the design. If these problems are not discovered in time, they will have a serious adverse impact on subsequent construction and operation and maintenance.

[0004] One of the main technical means to solve the above problems is to create a reference design modification template. Some companies have tried to establish data templates in the form of database associations or Excel tables. In the Excel data template, the associations between different data are established through scripts and formulas. At the same time, the corresponding relationship is established between the Excel data items and the CAD elements on the drawings, and a CAD plug-in is developed. Users only need to modify the data in the Excel template table, and then use the CAD plug-in to realize the automatic modification of the drawings.

[0005] Although the above software solves the problem of modifying the association between data and between data and drawings, the writing of Excel templates still relies on manual work. The process of establishing templates is very cumbersome, complicated, and prone to errors; and it requires manual analysis of the association between data and manual writing of formulas or rule scripts in Excel tables. This is not only inefficient, but also takes a lot of time to debug. Furthermore, in the process of updating drawings using the above templates, the correspondence between the data in the Excel template and the graphics and annotation information on the drawings is often not intuitive and convenient, and the lack of a visual interface or prompts also affects the work efficiency of designers.

[0006] Therefore, it is necessary to propose a new technical solution. Summary of the invention

[0007] In view of the defects in the prior art, the object of the present invention is to provide a method and system for generating a design template library based on Grasshopper.

[0008] According to a method for generating a design template library based on Grasshopper provided by the present invention, the method comprises the following steps:

[0009] Step S1: Open the typical design drawing in Rhinoceros software;

[0010] Step S2: Using the selection command in CAD, select the system element combination for which the template needs to be made;

[0011] Step S3: Developing a processing module program for copying the graphics and text blocks in the Rhinoceros software in the Grasshopper plug-in;

[0012] Step S4: convert all read original graphics elements into line segments;

[0013] Step S5: Obtain the endpoints of all line segments obtained by the graphic processing in step S4;

[0014] Step S6: Obtain the lower left corner boundary point of the selected graphic;

[0015] Step S7: automatically generating a battery block of a redrawn graphic on the Grasshopper plug-in canvas;

[0016] Step S8: reading the properties of the selected text annotation in the Rhinoceros software in the Grasshopper plug-in copy graphics module, including the GUID of the Rhinoceros software text annotation object, the coordinates of the lower left vertex and the upper right vertex of the text annotation rectangular envelope box, and the text content;

[0017] Step S9: Automatically connect panels with the same text in the Grasshopper plug-in;

[0018] Step S10: Develop a "TX-RX" paired battery so that it can be called by the Grasshopper plug-in, and automatically associate the paired TX and RX panels in the Grasshopper plug-in;

[0019] Step S11: All automatically generated battery blocks are automatically combined in the Grasshopper plug-in, which is called a Grasshopper plug-in module group. An automatically generated group includes the automatically generated redrawn battery block mentioned above, the panel automatically generated in the Grasshopper plug-in, and the "TX-RX" module.

[0020] Preferably, the system elements in step S2 are combined into corresponding devices or apparatuses and connections between the devices; the optical fiber distribution frame graphics and text annotations framed in the Rhinoceros software, the optical fiber distribution frame including optical cables;

[0021] The processing module program in step S3 is called a battery block in the Grasshopper plug-in; the processing module has no input and output terminals, but has a corresponding menu, which is presented by right-clicking the module; reading the data of the selected graphics and text annotations in the Rhinoceros software; the basic graphics elements of the secondary design include straight line segments, polylines, polygons, arcs, curves, and blocks. After reading all the selected graphics in the Grasshopper plug-in, a list of GUIDs of the original graphics elements is formed.

[0022] Preferably, the step S4 converts the block into a graphic. If the existing graphic element itself is a straight line segment, no processing is required; if it is a polyline or a polygon, it needs to be exploded into multiple straight line segments; if it is an arc or a curve, it needs to be equally divided into multiple segments, and then a straight line segment is formed according to the two endpoints of each curve segment;

[0023] The step S5 stores all endpoints as a tree structure string in the format of "GUID=X1, Y1, X2, Y2, X3, Y3...", each branch of the tree corresponds to an original figure before segmentation, and the coordinates of the connected segments after transformation are recorded in each branch.

[0024] Preferably, the step S6 calculates the minimum value of the X coordinates and Y coordinates of all endpoints to obtain the lower left corner boundary point of the selected graphic. When redrawing in the subsequent Grasshopper plug-in, the lower left corner boundary point needs to be offset to the origin of the Grasshopper plug-in canvas or the user's specified point on the Grasshopper plug-in canvas;

[0025] The step S7 uses C# language to write a program to generate a battery block without input and output at the user-specified point on the Grasshopper plug-in canvas. If the user does not specify a point, the default is at the origin of the Grasshopper plug-in canvas. The generated battery block contains a program for drawing on the Grasshopper plug-in canvas. According to the endpoint data of all the aforementioned line segments, the graphics in the Rhinoceros software are drawn on the Grasshopper plug-in canvas after translation and scaling transformation according to the user-selected point or origin.

[0026] Preferably, the coordinates of the upper right vertex in step S8 are world coordinates in the Rhinoceros software, and the text content is a string; in the Grasshopper plug-in, a Panel object is automatically generated on the Grasshopper plug-in canvas for each Rhinoceros software text annotation object;

[0027] The step S10 provides corresponding functions in the graphics and text blocks copied in the Rhinoceros software, and automatically searches for paired sending TX and receiving RX terminals in the Panel battery block automatically generated in step S8;

[0028] The relative positions of all battery blocks in step S11 are fixed, and the battery blocks in a group and the connecting lines between the battery blocks on the Grasshopper plug-in canvas move simultaneously.

[0029] The present invention also provides a design template library generation system based on Grasshopper, the system comprising the following modules:

[0030] Module M1: Open a typical design drawing in Rhinoceros software;

[0031] Module M2: Use the selection command in CAD to select the system element combination that needs to be templated;

[0032] Module M3: Develop a processing module program in the Grasshopper plug-in to replicate the graphics and text blocks in the Rhinoceros software;

[0033] Module M4: convert all read primitives into line segments;

[0034] Module M5: Obtain the endpoints of all line segments obtained by the graphics processing of module M4;

[0035] Module M6: Get the lower left corner boundary point of the selected figure;

[0036] Module M7: Automatically generate battery blocks with redrawn graphics on the Grasshopper plugin canvas;

[0037] Module M8: Read the properties of the selected text annotation in the Rhinoceros software in the Grasshopper plug-in copy graphics module, including the GUID of the Rhinoceros software text annotation object, the coordinates of the lower left vertex and the upper right vertex of the text annotation rectangular envelope box, and the text content;

[0038] Module M9: Automatically connect panels with the same text in the Grasshopper plugin;

[0039] Module M10: Develop a "TX-RX" paired battery so that it can be called by the Grasshopper plug-in and automatically associate the paired TX and RX panels in the Grasshopper plug-in;

[0040] Module M11: All automatically generated battery blocks in the Grasshopper plug-in are automatically combined into a Grasshopper plug-in module group. An automatically generated group includes the automatically generated redrawn battery block mentioned above, the panel automatically generated in the Grasshopper plug-in, and the "TX-RX" module.

[0041] Preferably, the system elements in the module M2 are combined into corresponding devices or apparatuses and connections between the devices; the optical fiber distribution frame graphics and text annotations framed in the Rhinoceros software, the optical fiber distribution frame including optical cables;

[0042] The processing module program in the module M3 is called a battery block in the Grasshopper plug-in; the processing module has no input and output terminals, but has a corresponding menu, which is presented by right-clicking the module; reading the data of the selected graphics and text annotations in the Rhinoceros software; the basic graphics of the secondary design include straight line segments, polylines, polygons, arcs, curves, and blocks. After reading all the selected graphics in the Grasshopper plug-in, a list of GUIDs of the original graphics is formed.

[0043] Preferably, the module M4 converts the block into a graphic. If the existing graphic element itself is a straight line segment, no processing is required; if it is a polyline or a polygon, it needs to be exploded into multiple straight line segments; if it is an arc or a curve, it needs to be equally divided into multiple segments, and then a straight line segment is formed according to the two endpoints of each curve segment;

[0044] The module M5 stores all endpoints as a tree structure string in the format of "GUID = X1, Y1, X2, Y2, X3, Y3...", each branch of the tree corresponds to an original figure before segmentation, and each branch records the coordinates of the segment connected at the beginning and the end after transformation.

[0045] Preferably, the module M6 calculates the minimum value of the X coordinates and Y coordinates of all endpoints to obtain the lower left corner boundary point of the selected graphic. When redrawing in the subsequent Grasshopper plug-in, the lower left corner boundary point needs to be offset to the origin of the Grasshopper plug-in canvas or the user's specified point on the Grasshopper plug-in canvas;

[0046] The module M7 is programmed in C# language to generate a battery block without input and output at a user-specified point on the Grasshopper plug-in canvas. If the user does not specify a point, the generated battery block is at the origin of the Grasshopper plug-in canvas by default. The generated battery block includes a program for drawing on the Grasshopper plug-in canvas. According to the endpoint data of all the aforementioned line segments, the graphics in the Rhinoceros software are drawn on the Grasshopper plug-in canvas after translation and scaling transformation according to the user-selected point or origin.

[0047] Preferably, the coordinates of the upper right vertex in the module M8 are world coordinates in the Rhinoceros software, and the text content is a string; in the Grasshopper plug-in, a Panel object is automatically generated on the Grasshopper plug-in canvas for each Rhinoceros software text annotation object;

[0048] The module M10 provides corresponding functions in the graphic and text blocks in the Rhinoceros software, and automatically searches for paired sending TX and receiving RX terminals in the Panel battery block automatically generated by the module M8;

[0049] The relative positions of all battery blocks in the module M11 are fixed, and the battery blocks in a group and the connecting lines between the battery blocks on the Grasshopper plug-in canvas move simultaneously.

[0050] Compared with the prior art, the present invention has the following beneficial effects:

[0051] 1. The present invention allows the computer to automatically compile a template for updating drawings in a one-click manner, and the graphics and annotation information on the drawings can be intuitively displayed in the template, and the data in the template corresponds one to one with the design elements on the drawings;

[0052] 2. The application of this template automatic generation technology can not only significantly save the time and cost of manually compiling templates, but also improve the work efficiency when using templates to modify drawings;

[0053] 3. The results of the operation of the present invention are more intuitive, and what you see is what you get, which further improves the efficiency of modifying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0055] Figure 1 Automatically generated flow chart for substation secondary system design template;

[0056] Figure 2 Design template drawings for optical fiber distribution frames (including optical cables);

[0057] Figure 3 A functional description diagram for processing module programs;

[0058] Figure 4 Convert all graphs into line segment graphs;

[0059] Figure 5 To calculate the minimum value graph of the X and Y coordinates of all endpoints;

[0060] Figure 6 To automatically generate a battery block diagram for redrawing graphics;

[0061] Figure 7 To generate a Panel diagram in the Grasshopper plugin;

[0062] Figure 8 To automatically connect Panel images with the same text;

[0063] Fig. 9 Pair TX and RX graphs for automatic connection;

[0064] Fig.10 Combine all automatically generated battery block diagrams in the Grasshopper plugin. DETAILED DESCRIPTION

[0065] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0066] The present invention proposes an automatic generation technology of a substation secondary system design template carrying local graphic information based on the Grasshopper plug-in of the Rhinoceros software. The technology can allow a computer to automatically compile a template for updating drawings in a one-click generation manner, and the graphics and annotation information on the drawings can be intuitively displayed in the template. There is a one-to-one correspondence between the data in the template and the design elements on the drawings. The application of the template automatic generation technology can not only significantly save the time and cost of manually compiling templates, but also increase the work efficiency when using the template to modify drawings, and the operation results are more intuitive, and what you see is what you get, which further improves the efficiency of modifying drawings.

[0067] Reference Figure 1 ,A method for generating a design template library based on Grasshopper includes the following steps:

[0068] Step S1: Open the typical design drawing in Rhinoceros software;

[0069] Step S2: Use the selection command in CAD to select the system element combination for which the template needs to be made, which generally corresponds to equipment or devices and the connection between devices. For example, the system element combination in the common sub-system construction drawing includes merging units, intelligent terminals, public terminals, line protection and control screens, line GIS intelligent component cabinets, optical fiber distribution frames, pipelines and cables, switches, etc. Figure 2 , The fiber optic distribution frame graphics and text annotations are framed in the Rhinoceros software CAD software. The fiber optic distribution frame includes optical cables. When selecting local graphics, in addition to the graphics, you also need to select the annotated text, because the secondary design mainly modifies the text annotations under the background of "Nine Unifications".

[0070] Step S3: Develop a processing module program in the Grasshopper plug-in to copy the graphic and text blocks in the Rhinoceros software. The processing module program is called a battery block in the Grasshopper plug-in. The module has no input and output terminals, but has a corresponding menu that can be displayed by right-clicking on the module. The functions of the above processing module program are discussed as follows.

[0071] Read the data of the selected graphics and text annotations in the Rhinoceros software. The basic graphics commonly used in secondary design include straight lines, polylines, polygons, arcs, curves, and blocks. After reading all the selected graphics in the Grasshopper plug-in, a list of the GUIDs of the original graphics is formed.

[0072] Step S4: Convert all the read primitives into line segments. In order to facilitate the redrawing of the graphics in the Grasshopper plug-in in the next step, all the primitives are converted into line segments through algorithms. First, convert the blocks into graphics. If the existing primitives themselves are straight line segments, no processing is required; if they are polylines or polygons, they need to be exploded into multiple straight line segments; if they are arcs or curves, they need to be divided into multiple segments, and then straight line segments are formed according to the two endpoints of each curve segment. In order to maintain a better visual effect when redrawing in the Grasshopper plug-in, it is recommended that the length of each curve segment is less than a fixed value. The more segments are divided equally, the better the approximate visual effect, but the amount of data is also larger. Therefore, under the premise of maintaining a satisfactory visual effect, it is very likely to reduce the number of equally divided curve segments.

[0073] Step S5: Obtain the endpoints of all line segments obtained by the graphics processing in step S4.

[0074] All endpoints are stored as tree structure strings in the format of "GUID = X1, Y1, X2, Y2, X3, Y3...". Each branch of the tree corresponds to an original figure before segmentation. In each branch, the coordinates of the segments connected at the beginning and end after transformation are recorded. For example, a data line 00e8100c-d70e-412b-9477-54fcc1cffe9a = 0,0,100,0,100,200 represents a polyline starting from the origin, along the X+ direction 100, and then along the Y+ direction 200. In the Rhinoceros software, the GUID of this polyline is 00e8100c-d70e-412b-9477-54fcc1cffe9a. The three-dimensional coordinates of each point are still separated by ",". The file name is named with the automatically generated GUID. The GUID and coordinate data are stored in an implicit terminal Pin of the processing module (battery block) generated in step S2. The implicit terminal Pin is only used to store data. The file name needs to be passed to the drawing battery block in step S7. In order to improve the loading speed, the above ASCII text can also be stored as binary data.

[0075] In this way, by storing the GUID of the Rhinoceros software primitive, the graphics in the Rhinoceros software can be reversed from Grasshopper.

[0076] Step S6: Obtain the lower left corner boundary point of the selected graphic.

[0077] Calculate the minimum value of the X and Y coordinates of all endpoints to obtain the lower left corner boundary point of the selected figure. When redrawing in the subsequent Grasshopper plug-in, this lower left corner boundary point needs to be offset to the origin of the Grasshopper plug-in canvas or the user's specified point on the Grasshopper plug-in canvas.

[0078] Step S7: Automatically generate a battery block for redrawing the graphics on the Grasshopper plug-in canvas.

[0079] A program is written in C# language to generate a battery block without input and output at the user-specified point on the Grasshopper plug-in canvas. If the user does not specify a point, the default is at the origin of the Grasshopper plug-in canvas. The generated battery block contains a program for drawing on the Grasshopper plug-in canvas. Based on the endpoint data of all the aforementioned line segments, the graphics in the Rhinoceros software can be drawn on the Grasshopper plug-in canvas after translation and scaling according to the user-selected point or origin.

[0080] Step S8: In the Grasshopper plug-in copy graphics module, read the properties of the selected text annotation in the Rhinoceros software, including the GUID of the Rhinoceros software text annotation object, the coordinates of the lower left vertex and the upper right vertex of the text annotation rectangular envelope box, and the text content. The coordinates of the upper right vertex are the world coordinates in the Rhinoceros software, and the text content is a string. Then, in the Grasshopper plug-in, a Panel object is automatically generated on the Grasshopper plug-in canvas for each Rhinoceros software text annotation object. Generally speaking, there is a scaling transformation coefficient between the height and width of the Panel and the width and height of the corresponding text annotation rectangular envelope box. This scaling coefficient can be automatically calculated by the program or manually specified; the position of the Panel in the Grasshopper plug-in canvas is determined by the coordinates of the lower left vertex of the Rhinoceros software text annotation rectangular envelope box and the translation of the lower left corner boundary point in step S6, refer to Figure 7 Next, the GUID of the text annotation block object in the Rhinoceros software is stored in the "Description" attribute of the automatically generated Panel object; the initial value of the PlainText attribute of the Panel is equal to the text content of the text annotation object.

[0081] Step S9: Automatically connect panels with the same text in the Grasshopper plug-in. For example, connect all "merging units", "intelligent terminals", "standby", and "process layer C network switches" end to end. The left end of the panel is the input, used to receive data, and the right end of the panel is the output, used to send data. When automatically connecting, connect the panels with the same text content in the manner of "front panel output Pin -> rear panel input Pin".

[0082] Step S10: Develop a "TX-RX" paired battery so that it can be called by the Grasshopper plug-in, and automatically associate the paired TX and RX Panels in the Grasshopper plug-in. Copy the corresponding functions provided in the graphics and text blocks in the Rhinoceros software, and automatically search for paired transmit TX and receive RX ports in the Panel battery block automatically generated in step S8 above, such as "4nA-TX1" and "4nA-RX1", "13n8-TX1" and "13n8-R1", "4n9-TX1" and "4n9-RX1". Connect the Panel containing the "TX" port to the "TX-RX" module. The output value of this module is the corresponding "RX" port. Automatically connect the output terminal of this module to the corresponding "TX" port of the Panel. Refer to Fig. 9 .

[0083] Step S11: All automatically generated battery blocks are automatically combined in the Grasshopper plug-in, which is called a Grasshopper plug-in module group. An automatically generated group includes the above-mentioned automatically generated redrawn battery blocks, the panel automatically generated in the Grasshopper plug-in, and the "TX-RX" module. After the combination, the relative positions of all battery blocks are fixed, and the battery blocks in a group and the connecting lines between the battery blocks on the Grasshopper plug-in canvas can be moved at the same time.

[0084] The present invention also provides a design template library generation system based on Grasshopper, the system comprising the following modules:

[0085] Module M1: Open a typical design drawing in Rhinoceros software.

[0086] Module M2: Use the selection command in CAD to select the system element combination for which a template needs to be made; the system element combination is the corresponding equipment or device and the connection between the devices; the fiber optic distribution frame graphics and text annotations selected in the Rhinoceros software, the fiber optic distribution frame includes optical cables.

[0087] Module M3: Develop a processing module program in the Grasshopper plug-in to copy the graphics and text blocks in the Rhinoceros software; the processing module program is called a battery block in the Grasshopper plug-in; the processing module has no input and output terminals, but has a corresponding menu, which is presented by right-clicking the module; read the data of the selected graphics and text annotations in the Rhinoceros software; the basic graphics elements of the secondary design include straight line segments, polylines, polygons, arcs, curves, and blocks. After reading all the selected graphics in the Grasshopper plug-in, a list of GUIDs of the original graphics elements is formed.

[0088] Module M4: Convert all read primitives into line segments; convert blocks into graphics. If the existing primitives are straight line segments, no processing is required; if they are polylines or polygons, they need to be exploded into multiple straight line segments; if they are arcs or curves, they need to be divided into multiple segments, and then straight line segments are formed based on the two endpoints of each curve segment.

[0089] Module M5: Obtain the endpoints of all line segments obtained by the graphics processing of module M4; store all endpoints as a tree structure string in the format of "GUID = X1, Y1, X2, Y2, X3, Y3...", each branch of the tree corresponds to an original graphic before segmentation, and the coordinates of the line segments connected at the beginning and end after the transformation are recorded in each branch.

[0090] Module M6: Get the lower left corner boundary point of the selected figure; calculate the minimum value of the X coordinates and Y coordinates of all endpoints to get the lower left corner boundary point of the selected figure. When redrawing in the subsequent Grasshopper plug-in, the lower left corner boundary point needs to be offset to the origin of the Grasshopper plug-in canvas or the user's specified point on the Grasshopper plug-in canvas.

[0091] Module M7: Automatically generate a battery block with redrawn graphics on the Grasshopper plug-in canvas; use C# language to write a program to generate a battery block without input and output at the user-specified point on the Grasshopper plug-in canvas. If the user does not specify a point, the default is at the origin of the Grasshopper plug-in canvas. The generated battery block contains a program for drawing on the Grasshopper plug-in canvas. According to the endpoint data of all the aforementioned line segments, the graphics in the Rhinoceros software are drawn on the Grasshopper plug-in canvas after translation and scaling according to the user-selected point or origin.

[0092] Module M8: Read the properties of the selected text annotation in the Rhinoceros software in the Grasshopper plug-in copy graphics module, including the GUID of the Rhinoceros software text annotation object, the coordinates of the lower left vertex and the upper right vertex of the text annotation rectangular envelope box, and the text content; the coordinates of the upper right vertex are the world coordinates in the Rhinoceros software, and the text content is a string; in the Grasshopper plug-in, a Panel object is automatically generated on the Grasshopper plug-in canvas for each Rhinoceros software text annotation object.

[0093] Module M9: Automatically connect panels with the same text in the Grasshopper plugin.

[0094] Module M10: Develop "TX-RX" paired batteries so that they can be called by the Grasshopper plug-in, and automatically associate the paired TX and RX panels in the Grasshopper plug-in; copy the corresponding functions provided in the graphics and text blocks in the Rhinoceros software, and automatically find the paired sending TX and receiving RX terminals in the Panel battery block automatically generated by module M8.

[0095] Module M11: All automatically generated battery blocks are automatically combined in the Grasshopper plug-in, which is called a Grasshopper plug-in module group. An automatically generated group includes the automatically generated redrawn battery blocks mentioned above, the Panel automatically generated in the Grasshopper plug-in, and the "TX-RX" module; the relative positions of all battery blocks are fixed, and the battery blocks in a group and the connecting lines between the battery blocks on the Grasshopper plug-in canvas move at the same time.

[0096] Those skilled in the art know that, in addition to realizing the system and its various devices, modules, and units provided by the present invention in a purely computer-readable program code, the system and its various devices, modules, and units provided by the present invention can be completely realized in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps to realize the same functions. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered as a hardware component, and the devices, modules, and units included therein for realizing various functions can also be regarded as structures within the hardware component; the devices, modules, and units for realizing various functions can also be regarded as both software modules for realizing the method and structures within the hardware component.

[0097] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.

Claims

1. A method for generating a design template library based on Grasshopper, characterized in that: The method comprises the following steps: Step S1: Open the typical design drawing in Rhinoceros software; Step S2: Using the selection command in CAD, select the system element combination for which the template needs to be made; Step S3: Developing a processing module program for copying the graphics and text blocks in the Rhinoceros software in the Grasshopper plug-in; Step S4: convert all read original graphics elements into line segments; Step S5: Obtain the endpoints of all line segments obtained by the graphic processing in step S4; Step S6: Obtain the lower left corner boundary point of the selected graphic; Step S7: automatically generating a battery block of a redrawn graphic on the Grasshopper plug-in canvas; Step S8: reading the properties of the selected text annotation in the Rhinoceros software in the Grasshopper plug-in copy graphics module, including the GUID of the Rhinoceros software text annotation object, the coordinates of the lower left vertex and the upper right vertex of the text annotation rectangular envelope box, and the text content; Step S9: Automatically connect panels with the same text in the Grasshopper plug-in; Step S10: Develop a "TX-RX" paired battery so that it can be called by the Grasshopper plug-in, and automatically associate the paired TX and RX panels in the Grasshopper plug-in; Step S11: All automatically generated battery blocks are automatically combined in the Grasshopper plug-in, which is called a Grasshopper plug-in module group. An automatically generated group includes an automatically generated redrawn battery block, a panel automatically generated in the Grasshopper plug-in, and a "TX-RX" module.

2. The method for generating a design template library based on Grasshopper according to claim 1, characterized in that: The system elements in step S2 are combined into corresponding devices, apparatuses and connections between the apparatuses; the optical fiber distribution frame graphics and text labels selected in the Rhinoceros software, the optical fiber distribution frame including optical cables; The processing module program in step S3 is called a battery block in the Grasshopper plug-in; the processing module has no input and output terminals, but has a corresponding menu, which is presented by right-clicking the module; reading the data of the selected graphics and text annotations in the Rhinoceros software; the basic graphics elements of the secondary design include straight line segments, polylines, polygons, arcs, curves, and blocks. After reading all the selected graphics in the Grasshopper plug-in, a list of GUIDs of the original graphics elements is formed.

3. The method for generating a design template library based on Grasshopper according to claim 1, characterized in that: The step S4 converts the primitive into a graphic. If the existing primitive itself is a straight line segment, no processing is required; if it is a polyline or a polygon, it needs to be expanded into multiple straight line segments; if it is an arc or a curve, it needs to be equally divided into multiple segments, and then a straight line segment is formed according to the two endpoints of each curve segment; The step S5 stores all endpoints as a tree structure string in the format of "GUID=X1,Y1,X2,Y2,X3,Y3...", each branch of the tree corresponds to an original graphic element before segmentation, and each branch records the coordinates of the segment connected at the beginning and the end after the transformation.

4. The method for generating a design template library based on Grasshopper according to claim 1, characterized in that: The step S6 calculates the minimum value of the X coordinates and Y coordinates of all endpoints to obtain the lower left corner boundary point of the selected graphic. When redrawing in the subsequent Grasshopper plug-in, the lower left corner boundary point needs to be offset to the origin of the Grasshopper plug-in canvas or the user's specified point on the Grasshopper plug-in canvas; The step S7 uses C# language to write a program to generate a battery block without input and output at the user-specified point on the Grasshopper plug-in canvas. If the user does not specify a point, the default is at the origin of the Grasshopper plug-in canvas. The generated battery block contains a program for drawing on the Grasshopper plug-in canvas. According to the endpoint data of all the aforementioned line segments, the graphics in the Rhinoceros software are drawn on the Grasshopper plug-in canvas after translation and scaling transformation according to the user-selected point or origin.

5. The method for generating a design template library based on Grasshopper according to claim 1, characterized in that: The coordinates of the upper right vertex in step S8 are world coordinates in the Rhinoceros software, and the text content is a string; in the Grasshopper plug-in, a Panel object is automatically generated on the Grasshopper plug-in canvas for each Rhinoceros software text annotation object; In the step S10, a function of copying existing graphics and text blocks in the Rhinoceros software is provided, and in the Panel battery block automatically generated in step S8, a paired sending signal TX terminal and receiving signal RX terminal are automatically found; The relative positions of all battery blocks in step S11 are fixed, and the battery blocks in a group and the connecting lines between the battery blocks on the Grasshopper plug-in canvas move simultaneously.

6. A design template library generation system based on Grasshopper, characterized in that: The system includes the following modules: Module M1: Open a typical design drawing in Rhinoceros software; Module M2: Use the selection command in CAD to select the system element combination that needs to be templated; Module M3: Develop a processing module program in the Grasshopper plug-in to replicate the graphics and text blocks in the Rhinoceros software; Module M4: convert all read primitives into line segments; Module M5: Obtain the endpoints of all line segments obtained by the graphics processing of module M4; Module M6: Get the lower left corner boundary point of the selected figure; Module M7: Automatically generate battery blocks with redrawn graphics on the Grasshopper plugin canvas; Module M8: Read the properties of the selected text annotation in the Rhinoceros software in the Grasshopper plug-in copy graphics module, including the GUID of the Rhinoceros software text annotation object, the coordinates of the lower left vertex and the upper right vertex of the text annotation rectangular envelope box, and the text content; Module M9: Automatically connect panels with the same text in the Grasshopper plugin; Module M10: Develop "TX-RX" paired battery so that it can be called by Grasshopper plug-in, and automatically associate the paired TX and RX panels in the Grasshopper plug-in; Module M11: All automatically generated battery blocks are automatically combined in the Grasshopper plug-in, which is called a Grasshopper plug-in module group. An automatically generated group includes the automatically generated battery block with redrawn graphics, the panel automatically generated in the Grasshopper plug-in, and the "TX-RX" module.

7. The Grasshopper-based design template library generation system according to claim 6, characterized in that: The system elements in the module M2 are combined into corresponding equipment, devices and connections between devices; the optical fiber distribution frame graphics and text labels selected in the Rhinoceros software, the optical fiber distribution frame includes optical cables; The processing module program in the module M3 is called a battery block in the Grasshopper plug-in; the processing module has no input and output terminals, but has a corresponding menu, which is presented by right-clicking the module; reading the data of the selected graphics and text annotations in the Rhinoceros software; the basic graphics of the secondary design include straight line segments, polylines, polygons, arcs, curves, and blocks. After reading all the selected graphics in the Grasshopper plug-in, a list of GUIDs of the original graphics is formed.

8. The Grasshopper-based design template library generation system according to claim 6, characterized in that: The module M4 converts the primitive into a graphic. If the existing primitive itself is a straight line segment, no processing is required; if it is a polyline or a polygon, it needs to be expanded into multiple straight line segments; if it is an arc or a curve, it needs to be equally divided into multiple segments, and then a straight line segment is formed according to the two endpoints of each curve segment; The module M5 stores all endpoints as a tree structure string in the format of "GUID=X1, Y1, X2, Y2, X3, Y3...", each branch of the tree corresponds to an original graphic element before segmentation, and each branch records the coordinates of the segment connected end to end after transformation.

9. The design template library generation system based on Grasshopper according to claim 6, characterized in that: The module M6 calculates the minimum value of the X coordinates and Y coordinates of all endpoints to obtain the lower left corner boundary point of the selected graphic. When redrawing in the subsequent Grasshopper plug-in, the lower left corner boundary point needs to be offset to the origin of the Grasshopper plug-in canvas or the user's specified point on the Grasshopper plug-in canvas; The module M7 is programmed in C# language to generate a battery block without input and output at a user-specified point on the Grasshopper plug-in canvas. If the user does not specify a point, the generated battery block is at the origin of the Grasshopper plug-in canvas by default. The generated battery block includes a program for drawing on the Grasshopper plug-in canvas. According to the endpoint data of all the aforementioned line segments, the graphics in the Rhinoceros software are drawn on the Grasshopper plug-in canvas after translation and scaling transformation according to the user-selected point or origin.

10. The Grasshopper-based design template library generation system according to claim 6, characterized in that: The coordinates of the upper right vertex in the module M8 are the world coordinates in the Rhinoceros software, and the text content is a string; in the Grasshopper plug-in, a Panel object is automatically generated on the Grasshopper plug-in canvas for each Rhinoceros software text annotation object; The module M10 provides a function of copying existing graphics and text blocks in the Rhinoceros software, and automatically searches for paired sending signal TX terminals and receiving signal RX terminals in the Panel battery block automatically generated by the module M8; The relative positions of all battery blocks in the module M11 are fixed, and the battery blocks in a group and the connecting lines between the battery blocks on the Grasshopper plug-in canvas move simultaneously.