Abaqus GUI中旋转区域和多对话框实现方法

本文介绍如何在Abaqus GUI程序设计中实现旋转区域和多个对话框功能。

先了解下帮助文档中相关内容的介绍:

1. 旋转区域Rotating regions

The FXSwitcher widget manages children that are positioned on top of each other.

FXSwitcher allows you to select which child should be shown by either sending it a message or calling its setCurrent method. When sending a message, you must set the message ID to FXSwitcher.ID_OPEN_FIRST for the first child. You must then increment the message ID from that value for the subsequent children, as shown in the following example. For example,

sw = FXSwitcher(parent)

FXRadioButton(hf, 'Option 1', sw, FXSwitcher.ID_OPEN_FIRST)

FXRadioButton(hf, 'Option 2', sw, FXSwitcher.ID_OPEN_FIRST+1)

hf1 = FXHorizontalFrame(sw)    

FXButton(hf1, 'Button 1')

FXButton(hf1, 'Button 2')

hf2 = FXHorizontalFrame(sw)

FXButton(hf2, 'Button 3')

FXButton(hf2, 'Button 4')

1.png Abaqus GUI中旋转区域和多对话框实现方法的图2

Abaqus GUI中旋转区域和多对话框实现方法的图3Abaqus GUI中旋转区域和多对话框实现方法的图4

2. 多对话框(Multiple dialogs

If your mode contains more than one dialog box, you must write the getNextDialog method in addition to the getFirstDialog method.

The previous dialog box is passed into the getNextDialog method so that you can determine where the user is in the sequence of dialog boxes and act accordingly. The getNextDialog method should return the next dialog box in the sequence, or it should return None to indicate that it has finished collecting input from the user. An example is as follows:

def getFirstDialog(self):

    self.dialog1 = PlateDB1(self)

    return self.dialog1

def getNextDialog(self, previousDb):

    if previousDb == self.dialog1:

        self.dialog2 = PlateDB2(self)

        return self.dialog2        

    elif previousDb == self.dialog2:

        self.dialog3 = PlateDB3(self)

        return self.dialog3

    else:

        return None

3. 案例

本案例只是为了演示两种方法的实现,可根据实际需求进行更改。先采用Abaqus中的RSG插件建立两个对话框,分别为Creat Part(保存的图形界面文件和注册文件名称分别为caseDB和case_form)和Example(保存的图形界面文件和注册文件名称分别为test1DB和test1_form),如下: 

3.png
4.png

3.1 旋转区域实现

caseDB.py文件中相关程序修改如下:

5.png

实现的效果如下:

6.png
7.png
8.png

Abaqus GUI中旋转区域和多对话框实现方法的图11

备注:此处截图中CONTINUE按钮的label为OK按钮。

3.2 多对话框实现

caseDB.py文件中相关程序修改如下:

9.png

将test1_form.py中的关键字注册相关程序(如下图),复制到caseform.py文件中,

10.png

caseform.py文件中相关程序修改如下:

11.png

Abaqus GUI中旋转区域和多对话框实现方法的图15

实现的效果如下:

12.png

Abaqus GUI中旋转区域和多对话框实现方法的图17

点击CONTINUE按钮后弹出下图:

13.png

本案例的源程序如附件所示(由于格式限制,附件将文件的后缀.py改为了.txt,使用时,直接改回.py即可)。

以下内容为付费内容,请购买后观看

包含4个文件   5人购买

脚本源程序

App下载
技术邻APP
工程师必备
  • 项目客服
  • 培训客服
  • 平台客服

TOP

18
13
2