当前位置:网站首页>在abaqus中使用PyQt设计GUI
在abaqus中使用PyQt设计GUI
2022-07-28 15:23:00 【CaeCoder】
环境说明
- 操作系统 :Window10
- Abaqus版本:Abaqus2017,其python版本为64位python2.7.3
- PyQt版本:PyQt4
安装PyQt
- 下载对应版本的PyQt4安装程序,关注微信公众号
CAE软件二次开发Lab,发送pyqt获取下载地址。
- 运行PyQt4安装exe,选择安装目录为Abaqus2017安装目录下win_64\tools\SMApy\python2.7,如下所示。
安装完成后,在abaqus的python目录下新增PyQt4文件夹,如下:
在Abaqus中运行PyQt4设计的GUI
- 编写PyQt4代码。
将如下代码保存为pyqt4_test.py文件。
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from PyQt4 import QtGui,QtCore
class Center(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setWindowTitle('center')
self.resize(250, 150)
# 重新设置大小
quit=QtGui.QPushButton('Close',self)
quit.setGeometry(10,10,60,35)
self.connect(quit,QtCore.SIGNAL('clicked()'),QtGui.qApp,QtCore.SLOT('quit()'))
self.center()
def center(self):
screen = QtGui.QDesktopWidget().screenGeometry()
# 获取屏幕分辨率
size = self.geometry()
# 获取组件大小
self.move((screen.width()-size.width())/2, (screen.height()-size.height())/2)
def main():
app=0
app = QtGui.QApplication([])
qb = Center()
qb.show()
app.exec_()
if __name__ == "__main__":
main()
- 打开Abaqus CAE,菜单File -> Run Script选择pyqt4_test.py,运行效果如下。

PyQt4说明
只所以选择pyqt4而不是pyqt5是因为当前abaqus的python版本都是python2.x,而pyqt5大多只支持python3.x。
网上查找PyQt5只有针对Python3的安装包而没有针对Python2.7的,所以暂时选择PyQt4。关于在abaqus上安装PyQt5的方法,以后有时间再尝试。
扫描下方二维码关注我的微信公众号 - CAE软件二次开发Lab,查看更多精彩文章!

边栏推荐
- Wei Jianjun couldn't catch up with Li Shufu by riding a BMW
- R语言使用fs包的file_delete函数删除指定文件夹下的指定文件、举一反三、dir_delete函数、link_delete函数可以用来删除文件夹和超链接
- 2021 Yahong pen test questions
- Brief tutorial for soft exam system architecture designer | software debugging
- Leetcode topic
- 解决电脑恶意广告弹窗的思路
- R语言ggplot2可视化绘制线图(line plot)、使用gghighlight包突出高亮线图中满足组合判断条件的线图(satisfies both condition A and B)
- laravel
- The little red book of accelerating investment, "rush to medical treatment"?
- LwIP development | realize TCP server through socket
猜你喜欢
![[Multisim Simulation] LM339 zero crossing circuit simulation](/img/ca/f6dae5fd298c00570407c2bdfa5118.png)
[Multisim Simulation] LM339 zero crossing circuit simulation

动态规划 --- 数位统计DP

Huada chip hc32f4a0 realizes RS485 communication DMA transceiver

About standard IO buffers

Deeply understand the fusing configuration of istio traffic management

Installation points and precautions of split angle probe

c语言编程当中两个!!的作用

Voltage to current / current to voltage module

IT远程运维是什么意思?远程运维软件哪个好?

mysql查询 limit 1000,10 和limit 10 速度一样快吗?如果我要分页,我该怎么办?
随机推荐
I came across Digital Phoenix coordinate Xuhui Meiluo city in Shanghai
Qt学习之Qt Designer(设计师)
LabVIEW Linx toolkit controls Arduino equipment (expansion-1)
一大早支付宝来短信说你中“奖”了?处理服务器挖矿病毒 - kthreaddi
Note: the value is rounded up to ten, hundred, thousand, ten thousand
PHP 图片上传
Numpy ndarray learning < II > miscellaneous records
QT打包
SCI scientific paper writing Growth Camp (full version)
One channel encoder, two channels Di speed measurement, RS485 serial port connected to one channel do alarm module ibf151
Qt学习之安装
使用py,根据日志记录自动生成周报
I'll show you a little chat! Summary of single merchant function modules
Is MySQL query limit 1000,10 as fast as limit 10? If I want to page, what should I do?
Detectron2 installation and testing
laravel
资本「断供」两年,我只能把公司卖了
The video Number finds the golden key, and Tiktok imitates the latecomers
CoDeSys realizes bubble sorting
五舅的思考