加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Workbench利用Python驱动MAPDL执行APDL命令

(2017-07-25 14:14:05)
标签:

workbench脚本

python驱动apdl

分类: Workbench技术及二次开发

微信公众号:CAE技术分享

与上一篇类似,只不过这次是驱动MAPDL执行APDL命令流,而上一篇是驱动DM执行Jscript脚本。相同的部分不再赘述,只对驱动命令这一部分稍作解释。

以下是python代码其中的部分:

##更新APDL模块

system1 = GetSystem(Name="APDL")

setupComponent1 = system1.GetComponent(Name="Setup")

setupComponent1.Update(AllDependencies=True)

setupComponent1.Refresh()

setup1 = system1.GetContainer(ComponentName="Setup")

setup1.Edit(

    Interactive=True,

    LoadInputFiles=True)

 

setup1.SendCommand( Command = """

       /prep7

       et,1,185

       vplot

       vsweep,all

       eplot

 

       CDOPT,IGES 

       CDWRITE,ALL,'file','cdb',,'file','iges'

       save

       /exit

       """)

 

##更新APDL模块

system1 = GetSystem(Name="APDL")

setupComponent1 = system1.GetComponent(Name="Setup")

setupComponent1.Update(AllDependencies=True)

用到的关键命令也是SendCommand,在SendCommand后面可以贴上APDL命令,最后用/exit关闭打开的APDL窗口,其中打开是利用PythonEdit()函数。

 

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有