首页/文章/ 详情

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

3年前浏览2541

本文介绍如何在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')

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.1 旋转区域实现

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

实现的效果如下:

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

3.2 多对话框实现

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

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

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

实现的效果如下:

点击CONTINUE按钮后弹出下图:

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

下面的内容为付费内容,购买后解锁。

内容简介:文章种案例的完整源程序

代码&命令二次开发Abaqus
著作权归作者所有,欢迎分享,未经许可,不得转载
首次发布时间:2020-11-13
最近编辑:3年前
TreatLee
博士 | CAE产品仿真经... catia abaqus isight Tosca
获赞 39粉丝 78文章 7课程 9
点赞
收藏

作者推荐

未登录
还没有评论

课程
培训
服务
行家

VIP会员 学习 福利任务 兑换礼品
下载APP
联系我们
帮助与反馈