Keywords

1 Introduction

Liquid distributors are a key component in packed distillation columns. As a kind of liquid distributors, chimney-tray gas–liquid distributor is widely used in chemical engineering. A good chimney-tray gas–liquid distributor has a direct impact on liquid initial distribution and mass transfer efficiency which are associated with the quality of products, so more attention should be paid to the chimney-tray gas–liquid distributor design process. Up to now, many efforts have been made to find a high efficient way to realize chimney-tray gas–liquid distributor design by the use of AutoCAD. To achieve this goal, some designers proposed that the AutoCAD software can be developed by Autolisp, which has a built-in GUI mini-language for creating model dialog boxes with automated layout and can also take part in the design process form scheme establishment to sketch drawing. However, the Autolisp itself has some defects, such as limited computation ability and limited modeling function. So Autolisp is not well suitable for 3D parametric design system. In some field of modern industries, 2D design has already been replaced by 3D parametric design. 3D solid models play an important role not only in the respects of communicating information about the structure and assembly relations, but also in the respects of externalizing the designer’s thought process by realizing the visualization of the product [1].

In engineering, the parametric design can be described as the process of transforming a set of parameters and constrains to the CAD system by taking advantage of the completed parametric design program [2, 3], then the CAD can automatically generate the model of the product which meets the specification of customers. In this article, the importance of 3D parametric design is addressed. Strategies and methods of the parametric design system of chimney-tray gas–liquid distributor based on AutoCAD VBA are presented. Parametric design system framework and flow of the program for its development are also discussed before conclusion.

2 Structure of Parametric Design System

2.1 Characteristic of Chimney-Tray Gas–Liquid Distributor

The typical chimney-tray gas–liquid distributor used for structured packing can be divided into three parts according to the function: distribution tray, chimney and collecting plate. If the column diameter is less than 3,000 mm, the chimneys are arranged in two rows, otherwise the row is four. Inside wall of the chimney, there are drainage steel angles; the liquid leaves the tray via holes on the chimneys and follows down by the drainage steel angle. At the same time, the gas below rises up along the chimneys. Thus, we can realize that both the liquid and gas distributes evenly. Generally, the size of the distributor varies with the diameter of the column, but the structure is unlikely to change greatly. The differences among different size chimney-tray gas–liquid distributors mainly reflect in length of distribution tray, length of collecting plate, numbers of chimney and so on. These variables are classified detailedly in Table 12.1.

Table 12.1 Variables of the chimney-tray gas–liquid distributors with different sizes

If the key parameters can be extracted as driven dimensions, the chimney-tray gas–liquid distributors with different sizes can be easily obtained by adjusting the value of the parameters.

2.2 Parametric Design System

The chimney-tray gas–liquid distributor design process can be defined by a set of design parameters and values; the system model is shown in Fig. 12.1.

Fig. 12.1
figure 1

Model for parametric design system

The key parameters are input in the system model through user interface, and then parameters are stored in the database, finally they will be picked up and processed by the parametric design program to build 3D solid model with the aid of AutoCAD. The data transfer and control process is supported by ActiveX Automation technology, which is based on COM standard. This kind of technology makes mutual control between VBA and AutoCAD possible.

3 Program Realizations

AutoCAD provides powerful drawing functions which are packaged in ActiveX in the form of attributes and methods. Object structure in AutoCAD is a tree structure; the root node of tree hierarchy is application object, based on which other objects are derived. These objects can be referenced in VBA development environment. VBA is an object-oriented programming language; designers can use VBA program codes to realize any drawing function of AutoCAD [4, 5]. What’s more, designers can also establish user interface in the VBA environment.

Taking all the factors into account, we can formulate the programming concepts in the VBA development language environment which is a pivotal part of the parametric design system. After the VBA program receives parameters from database, the program divides the chimney-tray gas–liquid distributor into several parts according to the size of manhole which is punched in the column wall. Finally, the program analyzes data of one part, acquires the shape information of this part and conveys instructions to AutoCAD to generate the 3D solid model. After this part is finished, the next part will be operated in the same way until the whole chimney-tray model is generated. The VBA program frame chart is shown below in Fig. 12.2.

Fig. 12.2
figure 2

Frame chart of the program

The procedures of building user interface and establishing VBA parametric design program will be illustrated as follows.

3.1 Create a New Project

The steps of creating a new project is: firstly open AutoCAD 2008 and choose “tools”; then click “Macros” and VBA Manger Dialog Box will appear; finally click “new” to create a project. If the project has been created, we just need to load it by click “load” in the VBA Manger Dialog Box.

3.2 Open the VBA IDE

There are three ways can be used to open the VBA IDE. First, type “VBAIDE” in the command line. Second, choose “tools” and click “Macros” and then choose Visual Basic Editor. Third, press “Alt + F11”.

3.3 Insert a UserForm and the Related Controls

To add a UserForm to the project, we just need to choose “insert” and then choose “UserForm”. The related controls are added via Toolbox, here we insert two Frame named as Input and Output. In the “Input” frame, we insert five Label named as The 3D Chimney-Tray Gas–Liquid Distributor Design Program, Column Diameter, Manhole Diameter, Chimney Width and Distance Between Chimney, then insert three Text Box and a Combo Box named as txtbox1, txtbox2, txtbox3 and chimney distance. In the “Output” frame, we insert four Label named as Chimney NO., Long Side length, Short side length and Hole NO., then insert four Text Box named as txtbox4, txtbox5, txtbox6 and txtbox7. At last insert one Label named as The 3D Chimney-Tray Gas–Liquid Distributor Design Program and two Command Button named as Exit and Draw (Fig. 12.3).

Fig. 12.3
figure 3

User interface of 3D chimey-tray gas–liquid distributor design program

This UserForm is a kind of dialog box, which is used as the user interface. Furthermore, we expand the function of the user interface, when the program is compiled and executed; we can not only acquire the 3D solid model of chimney-tray gas–liquid distributor, but also acquire some other data which is associated with the operation performance of the chimney-tray gas–liquid distributor [6].

3.4 Add Codes for UserForm

Because the code of the whole project is very long, here we select part of the code to illustrate. Double-click the UserForm to open the code window and enter the following codes.

3.4.1 Program Segment of Creating Chimney-Tray Gas–Liquid Distributor

  • Sub create_model()

    • ……

    • Dim polyline3(0) As Acad3DPolyline

    • Dim path As AcadLine

    • Dim p3(0 To 32) As Double

    • p3(0) = 43.5 + txtbox3: …… : p3(32) = 0#

    • Set polyline3(0) = ThisDrawing.ModelSpace.Add3DPoly(p3)

    • polyline3(0).Closed = True

    • Dim region4obj As Variant

    • region4obj = ThisDrawing.ModelSpace.AddRegion(polyline3)

    • Dim solid7obj As Acad3DSolid

    • Dim path7(0 To 2) As Double

    • Dim path8(0 To 2) As Double

    • path7(0) = 0#: path7(1) = 0#: path7(2) = 0#

    • path8(0) = 0#: path8(1) = -(txtbox1 - 203#):

    • path8(2) = 0#

    • Set path = ThisDrawing.ModelSpace.AddLine(path7, path8)

    • Set solid7obj = ThisDrawing.ModelSpace.AddExtrudedSolidAlongPath (region4obj(0), path)

    • ……

  • End Sub

3.4.2 Some Illustration About the Code

To obtain the 3D solid model, we need to draw section contour in the program. Here the “Add3DPolyline” method is used. Then we use “AddRegion” method to make polyline become region. Finally the “AddExtrudedSolidAlongPath” and “Boolean” method is applied to generate a 3D solid model. We can create 3D chimney-tray model in this way (Fig. 12.4).

Fig. 12.4
figure 4

Procedures of generating 3D chimney-tray model

3.5 Execute the Program

If the parametric design program is compiled correctly, execute the program, and we will obtain the whole 3D solid model of the chimney-tray gas–liquid distributor shown in Fig. 12.5. (The column diameter is 1,800 mm).

Fig. 12.5
figure 5

The 3D model of the chimney-tray gas–liquid distributor

Based on the generation of the 3D solid model, some post processing can be done to express the structure of the chimney-tray gas–liquid distributor. Here, two viewports are created in the AutoCAD model space drawing environment, one for the top view, another for the front view and detail drawings (Fig. 12.6).

Fig. 12.6
figure 6

Top view, front view and detail drawings of the chimney-tray gas–liquid distributor

4 Conclusions

The secondary development of AutoCAD by taking advantage of VBA makes 3D parametric design possible and provides a design platform which is intelligent, convenient and intuitionistic. In this way, many duplicated work in the drawing process can be avoided and at the same time the drawing quality and the efficiency can be enhanced. As a result of afore-mentioned advantages, 3D parametric design must be widely used in modern industry and design enterprises.