找回密码
 注册
Simdroid-非首页
查看: 139|回复: 3

[二次开发] Abaqus GUI中旋转区域和多对话框实现方法

[复制链接]
发表于 2020-11-13 16:45:15 | 显示全部楼层 |阅读模式 来自 江苏南京

本文介绍如何在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按钮后弹出下图:



文章中案例的完整源程序参考链接:http://www.jishulink.com/content/post/1288181

发表于 2020-11-14 17:21:10 | 显示全部楼层 来自 陕西西安
Simdroid开发平台
这么巧,我今天也琢磨这个。可惜只会写简单的切换,不知道楼主会不会多级切换,就像part模块中的create Part那个对话框,望能赐教。谢谢

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复 不支持

使用道具 举报

发表于 2020-11-20 15:56:04 | 显示全部楼层 来自 福建福州
学到了,多谢楼主
回复 不支持

使用道具 举报

 楼主| 发表于 2020-12-22 13:02:00 | 显示全部楼层 来自 中国
mikevenus 发表于 2020-11-14 17:21
这么巧,我今天也琢磨这个。可惜只会写简单的切换,不知道楼主会不会多级切换,就像part模块中的create Par ...

我没有试过这个,大致看了下程序,将hf1=...相关的代码重复一下应该可以实现的,你说的要求也不算是多级切换,只是多个切换。
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-9-22 06:16 , Processed in 0.038578 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表