Ruby language-based bidirectional parameterized modeling method for factory facilities

文档序号:134959 发布日期:2021-10-22 浏览:32次 中文

阅读说明:本技术 一种基于ruby语言的工厂设施双向参数化建模方法 (Ruby language-based bidirectional parameterized modeling method for factory facilities ) 是由 胡世南 丁炜杰 黄震宇 孙露 华帅 于 2021-07-20 设计创作,主要内容包括:本发明公开了一种基于ruby语言的工厂设施双向参数化建模方法,其特点是使用ruby语言在SketchUp软件上进行工厂设施的正向创建与反向修改的双向参数化建模,所述工厂设施的正向创建使用正向建模控件与正向建模脚本完成模型的参数化创建;所述工厂设施的反向修改由反向建模控件读取待修改模型上附加的参数,调用相应的反向建模脚本创建新模型,实现模型的参数化修改。本发明与现有技术相比具有快速实现厂房设施模型的创建,能通过更改参数的方式快速实现模型的修改,设计变更的响应速度,减少重复劳动,较好的解决了大多数SketchUp插件只能进行工厂设施的单向参数化建模的问题。(The invention discloses a ruby language-based bidirectional parameterized modeling method for factory facilities, which is characterized in that ruby language is used for carrying out bidirectional parameterized modeling of forward creation and reverse modification of the factory facilities on SketchUp software, and forward creation of the factory facilities uses a forward modeling control and a forward modeling script to complete parameterized creation of a model; and in the reverse modification of the plant facility, the reverse modeling control reads the parameters attached to the model to be modified, and calls a corresponding reverse modeling script to create a new model so as to realize the parameterized modification of the model. Compared with the prior art, the method has the advantages of quickly establishing a plant facility model, quickly modifying the model by changing parameters, reducing the response speed of design change, reducing repeated labor and better solving the problem that most SketchUp plug-ins can only carry out unidirectional parametric modeling of plant facilities.)

1. A bidirectional parameterized modeling method of factory facilities based on ruby language is characterized in that ruby language is used for carrying out bidirectional parameterized modeling of forward creation and reverse modification of factory facilities on SketchUp software and plug-in programs of displacement and copy of models of the bidirectional parameterized modeling, wherein the plug-in programs of the bidirectional parameterized modeling comprise a forward modeling control, a forward modeling script, a reverse modeling control, a reverse modeling script and a displacement and copy control; the forward building of the plant facilities uses a forward modeling control and a forward modeling script to complete the parameterization building of a model, and adds a control parameter input during modeling and the positioning point coordinates of the model to the model; in the reverse modification of the plant facility, the reverse modeling control reads the parameters attached to the model to be modified, calls a corresponding reverse modeling script to create a new model, attaches the new control parameters and the positioning point coordinates of the model to the new model, and deletes the old model to realize the parameterized modification of the model; the displacement and copy of the model realize the displacement and copy of the selected model by using a displacement and copy control, and the new positioning point coordinates are attached to the moved or copied model; and the displacement and copy control moves or copies the parameterized and created model and attaches the coordinates of the new positioning point to the moved or copied model.

2. The ruby language-based bi-directional parametric modeling method for plant facilities according to claim 1, wherein the number of the forward modeling control, the forward modeling script and the reverse modeling script is consistent with the number of types of devices or components that can be created, the forward modeling control and the forward modeling script of the same device or component are in a calling and called relationship, and the forward modeling script is called by the forward modeling control for parametric modeling.

3. The ruby language-based bi-directional parametric modeling method for plant facilities according to claim 1 or claim 2, wherein the reverse modeling script is in a mirror relationship with the forward modeling script.

Technical Field

The invention relates to the technical field of engineering design software development, in particular to a ruby language-based bidirectional parameterized modeling method for factory facilities.

Background

Two types of parametric modeling are generally adopted, one type is bidirectional parametric modeling, namely, a new construction of an engineering model is realized by editing parameters, and the created model can be repeatedly modified by modifying the parameters; the other is unidirectional parametric modeling, namely, the newly built model is intelligently realized by editing parameters, and the built model is only a three-dimensional graphic element and cannot be modified in a parametric mode. The parameterized design is a design process of writing the engineering itself into functions and processes, modifying initial conditions and obtaining engineering results by a computer. In engineering and mechanical design, parameters store all information of a three-dimensional computer model of a building and equipment, and a designer can create the three-dimensional model by editing the parameters. Sketch Up (architecture Sketch master) is a 3D architecture design software which is popular with designers and easy to use, and is the most popular three-dimensional design software in the design stage of the architecture scheme.

At present, SketchUp plug-in units commonly used in civil engineering industry mainly create curved surface and shape models in a parameterization mode, and lack the capability of creating industrial factory building facilities such as steel structure columns, crane beams and the like, and equipment models such as cranes, cutting machines and the like in a parameterization method. Furthermore, most of these plug-ins are only capable of unidirectional parametric modeling. In the design stage of the industrial plant scheme, the plant and equipment models are frequently changed, and the plug-in capable of performing bidirectional parametric modeling is obviously superior to the plug-in capable of performing unidirectional parametric modeling.

Disclosure of Invention

The invention aims to design a bidirectional parameterized modeling method of factory facilities based on a Ruby language aiming at the defects of the prior art, which adopts the Ruby language to realize bidirectional parameterized modeling of forward creation and reverse modification of industrial factory building facilities (including factory buildings, equipment and the like) and plug-in programs of displacement and copy of a model on SketchUp software, thereby improving the response speed of a scheme design stage to design change and reducing repeated labor, the bidirectional parameterized modeling method is simple, low in cost, safe and reliable, not only can quickly realize the creation of the factory building facility model through a parameter input mode, but also can quickly realize the modification of the model through a parameter change mode, and can still have the parameterized modification capability after the model is moved or copied, and a Ruby Application Programming Interface (API) is left by fully utilizing the Sketch Up, through Ruby programming, secondary development of the plug-in is carried out on the SketchUp, the function of the SketchUp is expanded, and the problem that most plug-ins can only carry out unidirectional parametric modeling is solved.

The purpose of the invention is realized as follows: a bidirectional parameterized modeling method for factory facilities based on a ruby language is characterized in that the ruby language is used for carrying out bidirectional parameterized modeling of forward creation and reverse modification of the factory facilities on SketchUp software and plug-in programs of displacement and copy of models of the bidirectional parameterized modeling, and the plug-in programs of the bidirectional parameterized modeling comprise: the system comprises five parts of program contents, namely a forward modeling control, a forward modeling script, a reverse modeling control, a reverse modeling script and a displacement and copy control; the forward building of the plant facilities uses a forward modeling control and a forward modeling script to complete the parameterization building of a model, and adds a control parameter input during modeling and the positioning point coordinates of the model to the model; in the reverse modification of the plant facility, the reverse modeling control reads the parameters attached to the model to be modified, calls a corresponding reverse modeling script to create a new model, attaches the new control parameters and the positioning point coordinates of the model to the new model, and deletes the old model to realize the parameterized modification of the model; and the displacement and copy of the model realize the displacement and copy of the selected model by using a displacement and copy control, and the new positioning point coordinates are attached to the moved or copied model.

The quantity of the forward modeling control, the forward modeling script and the reverse modeling script is consistent with the quantity of types of equipment or members which can be created, the forward modeling control and the forward modeling script of the same equipment or member are in a calling and called relation, and the forward modeling script is called by the forward modeling control to carry out parametric modeling.

The reverse modeling script and the forward modeling script are in a mirror image relationship.

Compared with the prior art, the method has the advantages of quickly establishing a plant facility model, quickly modifying the model by changing parameters, reducing the response speed of design change, reducing repeated labor, having simple modeling method, low cost, safety and reliability, still having the capability of being modified in a parameterization mode after the model is moved or copied, fully utilizing the Ruby Application Programming Interface (API) reserved in the Sketch Up, expanding the function of the Sketch Up and better solving the problem that most of plug-ins can only carry out unidirectional parameterization modeling.

Drawings

FIG. 1 is a software architecture diagram of a bi-directional parameterized modeling plug-in;

FIG. 2 is a diagram of a positioning function of a forward modeling control;

FIG. 3 is a diagram of a parameterized modeling function for forward modeling scripts;

FIG. 4 is a schematic diagram of an inverse parameterization model modification process;

FIG. 5 is a flowchart illustrating the operation of the displacement and copy control.

Detailed Description

The present invention will be described in further detail with reference to the following drawings and detailed description.

Example 1

The invention uses ruby language to carry out bidirectional parameterization modeling of forward creation and reverse modification of factory facilities on SketchUp software, and plug-in programs of displacement and copy of the model, and the specific bidirectional parameterization modeling process is as follows:

software architecture of bi-directional parameterized modeling plug-in

Referring to the attached figure 1, a plug-in program for bidirectional parametric modeling of a plant facility is developed by using a ruby language on the basis of SketchUp software, and the plug-in program consists of five parts, namely a forward modeling control, a forward modeling script, a reverse modeling control, a reverse modeling script and a displacement and copy control. The device comprises a plurality of forward modeling controls, a plurality of forward modeling scripts and a plurality of reverse modeling scripts, wherein each forward modeling control, each forward modeling script and each reverse modeling script corresponds to one type of equipment or component. The forward modeling control and the forward modeling script corresponding to the same equipment or component are in calling and called relation, and the forward modeling script is called by the forward modeling control to carry out parametric modeling; the reverse modeling script and the forward modeling script are in a mirror relationship, namely the reverse modeling script and the forward modeling script are completely the same as each other in terms of statement codes for controlling model generation, and the difference is that the forward modeling script of the same equipment or component can only be called by a corresponding forward modeling control; and all reverse modeling scripts can be invoked by the same reverse modeling control.

(II) construction of plant facility model

Referring to fig. 2, when a plant facility model is newly built, a forward modeling control is clicked first, and two points are positioned for the model in a model space. The forward modeling control opens a parameter entry interface.

Referring to fig. 3, the forward modeling control opens a parameter input interface, inputs parameters in the parameter input interface, calls a forward modeling script corresponding to the forward modeling control, and transmits the input parameters and the two-point positioning coordinates to the forward modeling script. The forward modeling script completes the creation of the model according to the input modeling parameters and positions the model at the position determined by the two points AB. Finally, the forward modeling script writes the model attribute information, the modeling parameters and the AB point coordinates on the newly created model respectively, so that the forward creation process of the model is completed.

(III) reverse parameterization modification of model

Referring to fig. 4, if the model needs to be modified in a reverse parameterization manner, the model to be modified is selected first, and a reverse modeling control is clicked. The reverse modeling control can sequentially read the model attribute information, the modeling parameters and the positioning AB point coordinate data which are added on the model, call the corresponding reverse modeling script according to the content of the model attribute information and then transmit the modeling parameters and the AB point coordinate data of the model to the reverse modeling control. The reverse modeling script reads the modeling parameters and the AB point coordinate data, generates a model parameter modification dialog box, modifies the related modeling parameters in the dialog box, clicks 'determination', creates a new model according to the modified parameters, writes the new modeling parameters and the AB point coordinate data onto the new model, and automatically deletes the old model to complete the reverse parameterization modification of the model.

(IV) moving or copying array of models

Referring to FIG. 5, if an array of moves or copies of a model is desired, the model to be modified is first selected, the displacement and copy control is clicked on, and the distance to move and the number to copy are entered in an open dialog box. The control copies and moves the model according to the input data, converts the displacement data into a correction value of the AB point coordinate attached to the model, and finishes correction of the AB point coordinate attached to the moved model.

According to the description of the step (three), if the parameterized model is moved by using the self-contained displacement command of SketchUp, the coordinate value of the AB point attached to the model is not changed, and if the moved model is parameterized and modified, the newly-built model is still positioned at the position before movement according to the original coordinate of the AB point. Therefore, the displacement and the control copying function are used for synchronously modifying the coordinates of the AB points on the model in the process of moving the model, and the position of the model after being modified in a parameterization mode is not disordered.

The invention can quickly realize the establishment of the plant facility model by inputting parameters, can also quickly realize the modification of the model by changing the parameters, and can still have the capability of being parameterized and modified after the model is moved or copied, thereby greatly improving the response speed of the scheme design stage to the design change and reducing the repeated labor.

The invention has been described in further detail in order to avoid limiting the scope of the invention, and it is intended that all such equivalent embodiments be included within the scope of the following claims.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:应用模块复用的方法、装置、系统、电子装置和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!