Method and system for generating SysML model to two-dimensional CAD model
Through the generation method of SysML model to two-dimensional CAD model, the automatic conversion of SysML internal structure diagram is a two-dimensional CAD model, which solves the problem of long manual conversion time and prone to errors in the existing technology, improves design efficiency and accuracy, and supports rapid design changes.
Patent Information
- Application Number
- CN202510671200.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, the generation method of SysML model to two-dimensional CAD model requires manual conversion, which is prone to errors, resulting in poor accuracy and consistency. When system design requirements change, the model needs to be manually modified to increase maintenance difficulty and cost.
The generation method of SysML model to two-dimensional CAD model is used to generate a two-dimensional CAD model through the internal structural diagram model of the system model, including identifying structural elements, ports and connector lists, obtaining geometric information and calling the application programming interface to generate corresponding graphics.
It realizes automatic conversion from SysML model to two-dimensional CAD model, reduces manual drawing time, improves design efficiency, ensures model consistency and accuracy, simplifies the design process, reduces human errors, and supports rapid design requirements updates.
Smart Images

Figure CN120493561A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of nuclear engineering design, and in particular to a method for generating a SysML model into a two-dimensional CAD model. Background Art
[0002] Nuclear engineering design is a highly complex and demanding technical field, encompassing multiple aspects, including nuclear reactors, fuel cycles, nuclear processes, and nuclear equipment. Accurate models and detailed drawings are crucial for ensuring design safety and effectiveness. Traditional design methods typically rely on manually drawn or modeled 2D drawings and 3D models, which are not only time-consuming and labor-intensive, but also require manual verification of design information, making them prone to human error and compromising design accuracy and consistency.
[0003] The Systems Modeling Language (SysML) is a graphical modeling language widely used in systems engineering to describe the structure, behavior, and requirements of a system. In nuclear engineering design, the use of Model-Based Systems Engineering (MBSE) and the SysML language allows users to start from user needs and gradually analyze design requirements, functions, and preliminary structural components, resulting in top-level and system-level architectural designs for nuclear engineering, including overall design, process systems, and control systems. Through SysML models, designers can clearly express system requirements and constraints, perform simulation and verification at different levels, and thus improve design reliability and safety.
[0004] Although SysML has significant advantages in system modeling, in nuclear engineering design, the final design results usually need to be converted into specific two-dimensional drawings or models for manufacturing and construction. The verified SysML model will be delivered to downstream professionals as an important output of system design. Driven by the system architecture plan, professional designers rely on two-dimensional design platforms such as CAD to carry out detailed design work and continuously refine the design plan. Traditional two-dimensional CAD model generation methods usually require manual conversion of the top-level system design architecture and related design information into a two-dimensional model, or manual conversion of the information in the already modeled SysML model into a two-dimensional model. This process has many problems, such as long manual conversion time and the need for a lot of manual intervention, easy errors resulting in poor accuracy and consistency, and the need to manually modify the model when system design requirements change, which increases maintenance difficulty and cost.
[0005] In order to overcome the limitations of traditional methods, achieve forward lossless transmission of information from top-level design to downstream professional design, and improve the efficiency and accuracy of nuclear engineering design, the inventors of this application designed a method and system for generating SysML models to two-dimensional CAD models in order to overcome the above-mentioned technical problems. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to overcome the defects of the existing two-dimensional CAD model generation methods, such as the long manual conversion time and the need for a large amount of manual intervention, the easy error resulting in poor accuracy and consistency, and the need to manually modify the model when the system design requirements change, thereby increasing the difficulty and cost of maintenance. A method and system for generating SysML models into two-dimensional CAD models are provided.
[0007] The present invention solves the above technical problems through the following technical solutions:
[0008] The present invention provides a method for generating a SysML model into a two-dimensional CAD model. The method is characterized in that the method generates the two-dimensional CAD model by using a system modeling language internal structure diagram model. The method comprises the following steps: S1, generating a two-dimensional CAD graphic based on the frame geometry information of the internal structure diagram of the system modeling language model; S2, identifying a list of structural elements, an associated port list, and a connector list in the internal structure diagram; S3, acquiring structural element information, calculating port geometry information, and generating a two-dimensional CAD graphic of the structural elements and ports; S4, acquiring connector geometry information and calling an application programming interface to generate a two-dimensional CAD graphic of the connector.
[0009] According to one or more embodiments of the present invention, the information in the internal structure diagram of the system modeling language model used to generate a two-dimensional CAD model includes mandatory information and optional information; the mandatory information includes: structural information, structural port information, and connector information in the internal structure diagram; the optional information includes: the frame content of the internal structure diagram.
[0010] According to one or more embodiments of the present invention, the structural information in the internal structure diagram includes view information and definition information; the structural port information includes port name information and port coordinate side length information; the connector information in the internal structure diagram includes connector shape information; the frame content of the internal structure diagram includes an outer frame, internal structure diagram description information and a header frame.
[0011] According to one or more embodiments of the present invention, the view information represents the rectangular size and spatial coordinates of the structural element; the definition information includes the structure name string, the font of the character, the font size of the character, and the coordinate points of the character within the rectangular space of the structural element; the port name information includes the port name string, the font of the character, the font size of the character, and the coordinate points of the character within the rectangular space of the internal structure frame; the port coordinate side length information represents the relative coordinate position of the port on the structural element and the side length of the port square; the connector shape information includes starting point information and end point information; the outer frame represents the rectangular outer frame of the internal structure diagram; the internal structure diagram description information includes an internal structure diagram descriptor composed of a character string; and the header frame includes an envelope box surrounded by a broken line and the outer rectangular frame of the internal structure diagram.
[0012] According to one or more embodiments of the present invention, generating a two-dimensional CAD model requires calculating the relative coordinate position of the port on the structural element in the internal structure diagram. The calculation method is as follows: the structural element rectangle oabc in the internal structure diagram is placed in the local coordinate system L, the zero point of the local coordinate system L is set at the vertex o of the structural element rectangle, the port p is located at any edge of the structural element rectangle, and the coordinate of the port in the local coordinate system L is set as p l The coordinates of the two vertices a and b on the edge where the port is located in the local coordinate system L are denoted as a l 、b l ; When the structural element rectangle oabc is placed in the global coordinate system G of the internal structure diagram after rigid transformation, the coordinates of points a and b in the global coordinate system G are set to a g 、b g , the port p has coordinates p in the global coordinate system G g The calculation formula is:
[0013] According to one or more embodiments of the present invention, step S1 includes the following steps: 11 , according to the rectangular frame information of the internal structure diagram, call the application programming interface of the two-dimensional CAD platform to create a rectangular frame of the same size; S 12 , according to the description information of the internal structure diagram, identify the coordinate starting point of the description information text in the internal structure diagram, the font and font size information of the text, call the application programming interface of the two-dimensional CAD platform, and in step S 11 Create text in the created rectangular box and set the corresponding font and font size information; 13 , according to the polyline coordinate information of the internal structure drawing header, call the application programming interface of the two-dimensional CAD platform to create the corresponding polyline.
[0014] According to one or more embodiments of the present invention, step S2 includes the following steps: 21 , identify the list of structural elements in the internal structure diagram; S 22 , identify the port list, port side length and port string information associated with each structural element in the internal structure diagram; S 23 , obtain the connector list in the internal structure diagram, and set the connector-associated port, connector line type and line width information.
[0015] According to one or more embodiments of the present invention, step S3 includes the following steps: 31 , obtain the geometric information of the structural elements in the internal structure diagram, and call the application programming interface of the two-dimensional CAD platform to create the two-dimensional graphics of the structural elements and the description string of the structural elements; S 32 , calculate the global coordinate information of the port in the internal structure diagram, and call the application programming interface of the two-dimensional CAD platform to create the port two-dimensional graphics and port character strings respectively.
[0016] According to one or more embodiments of the present invention, step S4 includes the following steps: 41 , in the two-dimensional CAD drawing, obtain the coordinate information of the start and target ports associated with the connector; S 42 , In the 2D CAD drawing, call the application programming interface to create the straight line segment corresponding to the connector, and set the line type and line width.
[0017] According to one or more embodiments of the present invention, the SysML model to two-dimensional CAD model generation system adopts the SysML model to two-dimensional CAD model generation method as described above, and the SysML model to two-dimensional CAD model generation system includes: a model parsing module, which is used to generate a two-dimensional CAD graphic based on the frame geometry information of the internal structure diagram of the system modeling language model; an element identification module, which is used to identify the structural element list, the associated port list and the connector list in the internal structure diagram; a geometry calculation module, which is used to obtain structural element information, calculate port geometry information, and generate a two-dimensional CAD graphic of the structural elements and ports; a connector generation module, which is used to obtain connector geometry information and call an application programming interface to generate a two-dimensional CAD graphic of the connector.
[0018] The positive progress effect of the present invention is:
[0019] The method for generating a SysML model into a two-dimensional CAD model of the present invention has at least the following advantages:
[0020] 1. Automated methods directly convert SysML internal structure diagrams into 2D CAD models, reducing manual drawing and interface information transfer time, significantly improving design efficiency. The automated process reduces reliance on manual labor and reduces errors and delays caused by improper human operation.
[0021] 2. The automatically generated 2D CAD model is highly consistent with the SysML model, avoiding information loss or errors that may occur during manual conversion and ensuring the accuracy and completeness of the design.
[0022] 3. The method of the present invention is seamlessly integrated with existing MBSE tools, CAD design tools and design modeling processes, which simplifies the design process and improves overall design efficiency.
[0023] 4. When design requirements change, the 2D design model can be quickly updated through automated methods, reducing the time and cost of change management. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and other features, properties and advantages of the present invention will become more apparent through the following description in conjunction with the accompanying drawings and embodiments, in which like reference numerals represent like features throughout, wherein:
[0025] Figure 1 It is a schematic diagram of the internal structure diagram (IBD) of the SysML model in one embodiment of the method for generating a SysML model into a two-dimensional CAD model according to the present invention.
[0026] Figure 2 This is a schematic diagram of the internal relationship between the structure, ports and connectors in the internal structure diagram (IBD) in one embodiment of the method for generating a SysML model to a two-dimensional CAD model of the present invention.
[0027] Figure 3 It is a schematic diagram of calculating port coordinate information in an embodiment of the method for generating a SysML model into a two-dimensional CAD model according to the present invention.
[0028] Figure 4 It is a flowchart of an embodiment of a method for generating a SysML model into a two-dimensional CAD model according to the present invention. DETAILED DESCRIPTION
[0029] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0030] Embodiments of the present invention will now be described in detail with reference to the accompanying drawings. Reference will now be made in detail to preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numerals will be used throughout the drawings to represent the same or similar parts. In addition, although the terms used in the present invention are selected from commonly known and commonly used terms, some of the terms mentioned in this specification may be selected by the applicant at his or her discretion, and their detailed meanings are explained in the relevant parts of the description herein. In addition, it is required to understand the present invention not only by the actual terms used, but also by the meaning implied by each term. At the same time, for ease of description, the dimensions of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0031] See also Figure 4 The present invention provides a method for generating a two-dimensional CAD model from a System Modeling Language (SysML) model. The method generates a two-dimensional CAD model using a System Modeling Language (SysML) internal structure diagram (IBD) model. The method comprises the following steps:
[0032] Step S1, generating a two-dimensional CAD drawing based on the frame geometry information of the internal structure diagram (IBD) of the System Modeling Language (SysML) model;
[0033] Step S2: identifying a list of structural elements, a list of associated ports, and a list of connectors in an internal structure diagram (IBD);
[0034] Step S3: obtaining structural element information, calculating port geometry information, and generating a two-dimensional CAD drawing of the structural element and the port;
[0035] Step S4: Obtain the connector geometry information and call the application programming interface (API) to generate a two-dimensional CAD drawing of the connector.
[0036] It should be noted that the SysML Internal Block Diagram (IBD) is a visual model that describes the input and output port relationships between various system components. This view model can include structural component information and associated port information from the SysML architecture model. Structural information is depicted using two-dimensional matrix-based graphics, with squares representing ports and describing the allowed input and output information for each structural element. The IBD also displays several connectors connecting different structural ports.
[0037] The method for generating a two-dimensional CAD model from a System Modeling Language (SysML) model of the present invention can efficiently, accurately and flexibly automatically generate a two-dimensional CAD model from a System Modeling Language (SysML) internal structure diagram (IBD). The method is applicable to fields such as nuclear engineering design. The generation method of the present invention can effectively improve design efficiency, ensure design quality and enhance design flexibility.
[0038] As a preferred embodiment of the method for generating a system modeling language (SysML) model into a two-dimensional CAD model of the present invention, the information used to generate the two-dimensional CAD model in the internal structure diagram of the system modeling language model includes mandatory information and optional information;
[0039] The required information includes: structural information in the internal structure diagram, structural port information, and connector information in the internal structure diagram;
[0040] The optional information includes: the frame content of the internal structure diagram.
[0041] As a preferred implementation of the method for generating a system modeling language (SysML) model to a two-dimensional CAD model of the present invention, the structural information in the internal structure diagram includes view information and definition information; the structural port information includes port name information and port coordinate side length information; the connector information in the internal structure diagram includes connector shape information; and the frame content of the internal structure diagram includes an outer frame, internal structure diagram description information and a header frame.
[0042] As a preferred embodiment of the method for generating a SysML model to a two-dimensional CAD model of the present invention, the view information represents the rectangular size and spatial coordinates of the structural element; the definition information includes a structure name string, a character font, a character size, and a coordinate point of the character within the rectangular space of the structural element;
[0043] The port name information includes the port name string, the font of the character, the font size of the character, and the coordinate point of the character in the rectangular space of the internal structure frame; the port coordinate side length information indicates the relative coordinate position of the port on the structural element and the side length of the port square;
[0044] The connector shape information includes start point information and end point information;
[0045] The outer frame represents the rectangular outer frame of the internal structure diagram; the internal structure diagram description information includes an internal structure diagram descriptor consisting of a character string; and the header frame includes an envelope box surrounded by a broken line and the outer rectangular frame of the internal structure diagram.
[0046] It should be noted that the information used to generate the 2D CAD drawing model in the Internal Block Diagram (IBD) model of the System Modeling Language (SysML) is as follows. Some of it is mandatory and key information for downstream transmission, while some is optional:
[0047] 1. Structural information in the view (required):
[0048] ■View information: Rectangular size and spatial coordinates of structural elements;
[0049] ■Definition information: structure name string, character font, font size, and coordinate points within the rectangular space of the structure element;
[0050] 2. Structure port information (required):
[0051] ■Port name information: port name string, character font, font size, and coordinate point in the IBD view box rectangular space;
[0052] ■The relative coordinate position of the port on the structural element, the side length of the port square;
[0053] 3. Connector information in the view (required):
[0054] ■Connector shape information: start point, end point;
[0055] 4. View frame content (optional):
[0056] ■Frame: The rectangular frame of the view;
[0057] ■View description information: a view descriptor consisting of a string;
[0058] ■Header frame: An envelope formed by three broken lines and the outer rectangular frame of the view;
[0059] by Figure 1 For example, the green part 10 in the figure shows the two structural elements of the power system and the control system; the port information is Figure 1 The black part 20 is named the power system interface and the control system interface, which are defined on the power system and control system structures respectively; the connector is the blue part 30 in the figure, which associates the power system interface and the control system interface; the view frame content is the red part 40 in the figure, including the view description information in the upper left corner of the figure and the outer rectangular frame, where the view description information is enclosed by the outer rectangle and the three inner broken lines.
[0060] The internal relationship between structures, ports and connectors in the IBD view is as follows: Figure 2As shown in the figure, each structure struct contains several ports, and each connector is associated with only two ports (the red and blue arrows emitted by the connector in the figure distinguish the starting port and the ending port).
[0061] The basic idea of generating a 2D CAD model from an internal structure drawing (IBD) is as follows: first, based on the IBD view frame, an outer rectangular frame of the 2D CAD drawing is drawn, which encloses all the graphics, and a corresponding descriptor and three broken lines are generated in the upper left corner of the rectangle to enclose the view description information (the view description information and the header frame are optional); secondly, by parsing the structural elements in the IBD drawing, based on the spatial information of each element in the view, and using the coordinate position of the structural element in the IBD drawing, a 2D icon representing the structural element is created at the corresponding coordinate position on the 2D CAD drawing; then, based on the coordinate position of the 2D icon, the coordinate point where the port should be placed in the 2D CAD global coordinate system is calculated (this coordinate point must be on the structural element icon), and the port is created at this coordinate point; finally, based on the port coordinates, corresponding connection lines are created for the connectors in the IBD drawing to obtain the final 2D CAD drawing.
[0062] See also Figure 3 As a preferred embodiment of the method for generating a SysML model to a two-dimensional CAD model of the present invention, generating a two-dimensional CAD model requires calculating the relative coordinate positions of the ports on the structural elements in the internal structure diagram. The calculation method is as follows:
[0063] Place the structural element rectangle oabc in the internal structure diagram in the local coordinate system L, set the zero point of the local coordinate system L at the vertex o of the structural element rectangle, and the port p is located at any side of the structural element rectangle. Let the coordinate of the port in the local coordinate system L be p l The coordinates of the two vertices a and b on the edge where the port is located in the local coordinate system L are denoted as a l 、b l ;
[0064] When the structural element rectangle oabc is placed in the global coordinate system G of the internal structure diagram after rigid transformation, the coordinates of points a and b in the global coordinate system G are set to a g 、b g , the port p has coordinates p in the global coordinate system G g The calculation formula is:
[0065]
[0066] It should be noted that generating a 2D CAD model requires calculating the coordinate position of the structure information port in the IBD view. The 2D spatial information of the port and the current structure is as follows: Figure 3 shown. Figure 3 Where oabc is the rectangular icon information of the structure in IBD, its local coordinate system zero point is o, its port is located at any side of the rectangular icon, in the local coordinate system L, it is assumed that the port coordinate is p l The coordinates of the two vertices a and b on the edge where the port is located are respectively recorded as a l 、b l .
[0067] When the icon oabc is placed in the global coordinate system G of the IBD diagram after rigid transformation, the coordinates of points a and b in G are given as a g 、b g , then the coordinate of port p in G is p g The calculation formula is as above formula (1).
[0068] See also Figure 4 As a preferred embodiment of the method for generating a SysML model to a two-dimensional CAD model according to the present invention, step S1 includes the following steps:
[0069] Step S 11 , based on the rectangular outer frame information of the internal structure diagram, call the application programming interface (API) of the 2D CAD platform to create a rectangular frame of the same size;
[0070] Step S 12 , according to the description information of the internal structure diagram, identify the coordinate starting point of the description information text in the internal structure diagram, the font and font size information of the text, call the application programming interface (API) of the two-dimensional CAD platform, and in step S 11 Create text in the created rectangular frame and set the corresponding font and font size information;
[0071] Step S 13 , according to the polyline coordinate information of the internal structure drawing header, call the application programming interface (API) of the two-dimensional CAD platform to create the corresponding polyline.
[0072] Preferably, step S1 generates view frame information using a given IBD view. Step S1 may specifically include the following steps:
[0073] Step S 11 , Based on the rectangular frame information of the IBD view, i.e., the length and width data, call the 2D CAD platform API to create a rectangular frame of the same size;
[0074] Step S 12 , according to the description information of the IBD view, identify the coordinate starting point of the description information text in the drawing, the font and font size information of the text, and then call the 2D CAD platform API to create text in the rectangular box of the previous step and set the corresponding font and font size information;
[0075] Step S 13 , According to the coordinate information of the three-segment polyline in the IBD view header, call the 2D CAD platform API to create the corresponding three-segment polyline.
[0076] See also Figure 4 As a preferred embodiment of the method for generating a SysML model to a two-dimensional CAD model according to the present invention, step S2 includes the following steps:
[0077] Step S 21 , identify the list of structural elements in the internal structure diagram (IBD);
[0078] Step S 22 ,Identify the port list, port side length and port string information associated with each structural element in the internal structure diagram (IBD);
[0079] Step S 23 , obtain the connector list in the internal structure diagram (IBD), and set the connector-associated port, connector line type and line width information.
[0080] Preferably, step S 21 Traverse all elements in the IBD view, capture all structural elements that describe the architecture composition, and form a structural element list struct_list; if struct_list is empty, exit the 2D CAD generation process.
[0081] Preferably, step S 22 Traverse struct_list, for each structure struct i Proceed as follows:
[0082] Identify the struct in the IBD view i For the port defined by the structure, set port.size = len according to the side length len of the square of the port in the view; at the same time, set the character information of the port (including the string, font, font size, and the spatial coordinates of the string in the IBD view), and add the port to the struct i Port list of structure struct i .portList.
[0083] Preferably, step S 23 Traversing struct i .portList, for each port j , identify the associated port i The connector of the port and do the following:
[0084] If connector is not in the connector list connectorList, set connector.source to a tuple (struct i ,port j ), add it to the list connectorList;
[0085] If connector is in the connector list connectorList, set connector.target to a tuple (struct i ,port j );
[0086] Record the line type, line width and other information of the connector in the IBD view in connector.lineStyle.
[0087] Preferably, step S 23 The following steps are then included:
[0088] Traversing struct i The next port of the structure definition and jump to step S 22 .
[0089] See also Figure 4 As a preferred embodiment of the method for generating a SysML model to a two-dimensional CAD model according to the present invention, step S3 includes the following steps:
[0090] Step S 31 , obtain the geometric information of the structural elements in the internal structure diagram, and call the application programming interface (API) of the two-dimensional CAD platform to create the two-dimensional graphics of the structural elements and the description string of the structural elements respectively;
[0091] Step S 32 , calculate the global coordinate information of the port in the internal structure diagram, and call the application programming interface (API) of the two-dimensional CAD platform to create the port two-dimensional graphics and port character strings respectively.
[0092] Preferably, step S 31 Traverse struct_list, for each structure struct i Proceed as follows:
[0093] Use struct iThe rectangular element information in IBD is automatically created according to its size and coordinate information using the 2D CAD platform API at the corresponding coordinate position in the CAD drawing. The structural element name is created at the corresponding coordinate in the rectangular figure, and the font and size of the name string are set.
[0094] Preferably, step S 32 Traversing struct i Port list struct i .portList, for each port, perform the following operations:
[0095] Use formula (1) to calculate the port coordinate p g , record port.globalLocation = p g ;
[0096] Using the 2D platform API, create a square shape based on the port.size data with the above coordinates as the center point;
[0097] Use the 2D platform API to create a port string at the corresponding coordinates based on the port's character information.
[0098] It should be noted that step S3 of the present invention overcomes the difficulty of the prior art: how to obtain the spatial coordinates of each port in the view. This coordinate information becomes the direct input for driving the creation of ports in the 2D CAD drawing. By using the previous coordinate transformation formula to calculate the coordinates of the ports in global space, step S3 of the present invention provides excellent conditions for the subsequent 2D CAD model.
[0099] See also Figure 4 As a preferred embodiment of the method for generating a SysML model to a two-dimensional CAD model according to the present invention, step S4 includes the following steps:
[0100] Step S 41 ,In the two-dimensional CAD drawing, obtain the coordinate information of the start and target ports associated with the connector;
[0101] Step S 42 In a 2D CAD drawing, call the application programming interface (API) to create a straight line segment corresponding to the connector and set the line type and line width.
[0102] Preferably, step S 41 Traverse the connectorList and for each connector i Proceed as follows:
[0103] Get the connectori .source and connector i The two port coordinates corresponding to .target are port.globalLocation.
[0104] Preferably, step S 42 Using the 2D CAD platform API, in the previous step S 41 Create a straight line segment between the obtained start and target port coordinates, and i The line type and line width information in IBD sets the line type and line width of the straight line segment.
[0105] Preferably, step S 42 The following steps are then included:
[0106] Generate a list of CAD structural elements and compare it with the SysML structural element list. If there is no difference, the algorithm exits and the 2D CAD model generation is completed.
[0107] As described above, the method for generating a System Modeling Language (SysML) model to a two-dimensional CAD model of the present invention aims at the automatic conversion of SysML models to two-dimensional CAD models. It defines a method for generating two-dimensional spatial geometric coordinates for constructing a two-dimensional CAD model by converting and calculating local coordinates to global coordinates, starting from the intrinsic relationships and spatial coordinate information of model elements such as structures, ports and connectors in the SysML internal structure diagram, thereby ensuring accurate conversion of information. It also proposes an algorithm and implementation method for converting from SysML internal module diagrams to two-dimensional CAD diagrams, which can efficiently and accurately convert SysML model data into two-dimensional CAD models, thereby realizing automated data transmission of SysML models to downstream professional designs.
[0108] The present invention further provides a system for generating a SysML model into a two-dimensional CAD model. The system for generating a SysML model into a two-dimensional CAD model adopts the method for generating a SysML model into a two-dimensional CAD model as described above. The system for generating a SysML model into a two-dimensional CAD model comprises:
[0109] Model parsing module, used to generate 2D CAD graphics based on the frame geometry information of the internal structure diagram of the system modeling language model;
[0110] An element identification module is used to identify the structural element list, associated port list and connector list in the internal structure diagram;
[0111] The geometry calculation module is used to obtain structural element information, calculate port geometry information, and generate two-dimensional CAD graphics of structural elements and ports;
[0112] The connector generation module is used to obtain the connector geometry information and call the application programming interface (API) to generate the two-dimensional CAD graphics of the connector.
[0113] In summary, the method and system for generating a SysML model into a two-dimensional CAD model are applicable to fields such as nuclear engineering design. The advantages thereof are mainly reflected in improving design efficiency, ensuring design quality, and enhancing design flexibility, as follows:
[0114] 1. Automated methods directly convert SysML internal structure diagrams into 2D CAD models, reducing manual drawing and interface information transfer time, significantly improving design efficiency. The automated process reduces reliance on manual labor and reduces errors and delays caused by improper human operation.
[0115] 2. The automatically generated 2D CAD model is highly consistent with the SysML model, avoiding information loss or errors that may occur during manual conversion and ensuring the accuracy and completeness of the design.
[0116] 3. The method of the present invention is seamlessly integrated with existing MBSE tools, CAD design tools and design modeling processes, which simplifies the design process and improves overall design efficiency.
[0117] 4. When design requirements change, the 2D design model can be quickly updated through automated methods, reducing the time and cost of change management.
[0118] Although specific embodiments of the present invention have been described above, those skilled in the art will appreciate that these are merely illustrative and that the scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, and such changes and modifications are intended to fall within the scope of the present invention.
Claims
1. A method for generating a SysML model into a two-dimensional CAD model, characterized in that: The generation method uses the internal structure diagram model of the system modeling language to generate a two-dimensional CAD model, and the generation method includes the following steps: S1. Generate a two-dimensional CAD drawing based on the frame geometry information of the internal structure diagram of the system modeling language model; S2, identifying a list of structural elements, a list of associated ports, and a list of connectors in the internal structure diagram; S3, obtaining structural element information, calculating port geometry information, and generating a two-dimensional CAD drawing of the structural element and the port; S4. Obtain the geometric information of the connector and call the application programming interface to generate a two-dimensional CAD drawing of the connector.
2. The method for generating a SysML model into a two-dimensional CAD model according to claim 1, wherein: The information used to generate the 2D CAD model in the internal structure diagram of the system modeling language model includes mandatory information and optional information; The required information includes: structural information in the internal structure diagram, structural port information, and connector information in the internal structure diagram; The optional information includes: the frame content of the internal structure diagram.
3. The method for generating a SysML model into a two-dimensional CAD model according to claim 2, wherein: The structural information in the internal structure diagram includes view information and definition information; the structural port information includes port name information and port coordinate side length information; the connector information in the internal structure diagram includes connector shape information; the frame content of the internal structure diagram includes an outer frame, internal structure diagram description information and a header frame.
4. The method for generating a SysML model into a two-dimensional CAD model according to claim 3, wherein: The view information indicates the rectangular size and spatial coordinates of the structural element; the definition information includes the structure name string, the font of the character, the font size of the character, and the coordinate points of the character in the rectangular space of the structural element; The port name information includes the port name string, the font of the character, the font size of the character, and the coordinate point of the character in the rectangular space of the internal structure frame; the port coordinate side length information indicates the relative coordinate position of the port on the structural element and the side length of the port square; The connector shape information includes start point information and end point information; The outer frame represents the rectangular outer frame of the internal structure diagram; the internal structure diagram description information includes an internal structure diagram descriptor consisting of a character string; and the header frame includes an envelope box surrounded by a broken line and the outer rectangular frame of the internal structure diagram.
5. The method for generating a SysML model into a two-dimensional CAD model according to claim 1, wherein: To generate a 2D CAD model, you need to calculate the relative coordinate positions of the ports on the structural elements in the internal structure diagram. The calculation method is as follows: Place the structural element rectangle oabc in the internal structure diagram in the local coordinate system L, set the zero point of the local coordinate system L at the vertex o of the structural element rectangle, and the port p is located at any side of the structural element rectangle. Let the coordinate of the port in the local coordinate system L be p l The coordinates of the two vertices a and b on the edge where the port is located in the local coordinate system L are denoted as a l 、b l ; When the structural element rectangle oabc is placed in the global coordinate system G of the internal structure diagram after rigid transformation, the coordinates of points a and b in the global coordinate system G are set to a g 、b g , the port p has coordinates p in the global coordinate system G g The calculation formula is:
6. The method for generating a SysML model into a two-dimensional CAD model according to claim 1, wherein: The step S1 includes the following steps: S 11 , according to the rectangular outer frame information of the internal structure diagram, call the application programming interface of the two-dimensional CAD platform to create a rectangular frame of the same size; S 12 , according to the description information of the internal structure diagram, identify the coordinate starting point of the description information text in the internal structure diagram, the font and font size information of the text, call the application programming interface of the two-dimensional CAD platform, and in step S 11 Create text in the created rectangular frame and set the corresponding font and font size information; S 13 , according to the polyline coordinate information of the internal structure drawing header, call the application programming interface of the two-dimensional CAD platform to create the corresponding polyline.
7. The method for generating a SysML model into a two-dimensional CAD model according to claim 1, wherein: The step S2 comprises the following steps: S 21 , identify the list of structural elements in the internal structure diagram; S 22 , identify the port list, port side length and port string information associated with each structural element in the internal structure diagram; S 23 , obtain the connector list in the internal structure diagram, and set the connector-associated port, connector line type and line width information.
8. The method for generating a SysML model into a two-dimensional CAD model according to claim 1, wherein: The step S3 comprises the following steps: S 31 , obtain the geometric information of the structural elements in the internal structure diagram, and call the application programming interface of the two-dimensional CAD platform to create the two-dimensional graphics of the structural elements and the description string of the structural elements respectively; S 32 , calculate the global coordinate information of the port in the internal structure diagram, and call the application programming interface of the two-dimensional CAD platform to create the port two-dimensional graphics and port character strings respectively.
9. The method for generating a SysML model into a two-dimensional CAD model according to claim 1, wherein: The step S4 comprises the following steps: S 41 ,In the two-dimensional CAD drawing, obtain the coordinate information of the start and target ports associated with the connector; S 42 , In the 2D CAD drawing, call the application programming interface to create the straight line segment corresponding to the connector, and set the line type and line width.
10. A system for generating a SysML model into a two-dimensional CAD model, the system adopting the method for generating a SysML model into a two-dimensional CAD model according to any one of claims 1 to 9, the system comprising: Model parsing module, used to generate 2D CAD graphics based on the frame geometry information of the internal structure diagram of the system modeling language model; An element identification module is used to identify the structural element list, associated port list and connector list in the internal structure diagram; The geometry calculation module is used to obtain structural element information, calculate port geometry information, and generate two-dimensional CAD graphics of structural elements and ports; The connector generation module is used to obtain the connector geometry information and call the application programming interface to generate the two-dimensional CAD graphics of the connector.