当前位置:网站首页>ANSYS二次开发 - MFC界面调用ADPL文件
ANSYS二次开发 - MFC界面调用ADPL文件
2022-07-28 15:23:00 【CaeCoder】
开发流程
ANSYS-MFC二次开发的思路其实是特别简单的,通常MFC主要是设计界面,然后从MFC界面中读取要设计的参数,然后根据这些设置了的参数生成APDL代码,然后再调用ANSYS的批处理功能,从而完成特定的程序求解。当然在求解结束后,也可以将ANSYS计算的结果显示在界面中,从而完成针对特定模型的有限元参数化模型计算软件。具体的流程如下图所示。

开发代码
界面设计的功能最常用的控件无非是按钮、文本框、下拉列表、图片显示等功能,完成数据的数据和功能的触发功能,这里不做介绍。
然后根据参数设置的内容,生成apdl语言,并将其存储在文本文档中,例如“file.dat”
用批处理的方法打开ANSYS。
//计算按钮
void ModelSim::OnBnClickedButton10()
{
ModelList.DeleteAllItems();
DeleteTempFile();//删除结果
CString WorkOut = WorkDir +_T("\\Model.out");
CString path_2 = AnsysDir + _T(" -b -p ane3fl -dir ")+ WorkDir +_T(" -i ") + WorkPath + _T(" -o ") + WorkOut;
string path(CT2A(path_2.GetString()));
WinExec(path.data(),SW_MINIMIZE);//开始
}
其中,
- AnsysDir为Ansys所在的目录,例如C:\Program Files\ANSYS Inc\v180\ansys\bin\winx64\ANSYS180.exe
- WorkDir为Ansys的工作目录,即ansys仿真工程所在的目录,例如C:\Users\15321\Desktop\test
- WorkPath为file.dat所在的目录,例如C:\Users\15321\Desktop\test\file.dat
- WorkOut为file.out所在的目录,例如C:\Users\15321\Desktop\test\file.out
转载自 : https://www.cnblogs.com/gaozihan/p/10844007.html
原文作者: 德才兼备
发表日期: 2019-05-10
扫描下方二维码关注我的微信公众号 - CAE软件二次开发Lab,阅读更多精彩内容!

边栏推荐
- Sudden! MSI CEO Jiang Shengchang fell to death
- PHP获取小程序码,小程序带参数跳转
- php关于数据量大导出数据或者遍历数据导致内存溢出超时等问题
- 解决uniapp等富文本图片宽度溢出
- The epidemic dividend disappeared, and the "home fitness" foam dissipated
- JS linked list 01
- Huada chip hc32f4a0 realizes RS485 communication DMA transceiver
- NTC, PT100 thermal resistance to 4-20mA temperature signal converter
- mysql 查看事件状态语句和修改办法
- 加速投资的小红书,“病急乱投医”?
猜你喜欢

The epidemic dividend disappeared, and the "home fitness" foam dissipated

2021 Kent interview question 1

A good start

About standard IO buffers

JS linked list 02

Installation points and precautions of split angle probe

1. Simple command line connection to database

正大杯黑客马拉松数据解析竞赛

Roson的Qt之旅#101 Qt Quick中的模型和视图

flashfxp 530 User cannot log in. ftp
随机推荐
ffmpeg获取首帧
JS stack
R language uses file of FS package_ Delete function deletes the specified file under the specified folder, draw inferences from one instance, dir_ Delete function, link_ The delete function can be use
Zhaoqi science and technology innovation and entrepreneurship competition talent introduction platform, mass entrepreneurship and entrepreneurship competition high-level talent introduction
2021 肯特面试题1
Sudden! MSI CEO Jiang Shengchang fell to death
mysql查询 limit 1000,10 和limit 10 速度一样快吗?如果我要分页,我该怎么办?
PHP计算坐标距离
仅需三步 轻松实现远程办公
Basic structure and operation principle of solar street lamp
Fifth uncle's thinking
How to measure the vibrating wire sensor by vibrating wire acquisition module?
JS linked list 01
LwIP development | realize TCP server through socket
js中的for循环总结
IT远程运维是什么意思?远程运维软件哪个好?
The little red book of accelerating investment, "rush to medical treatment"?
Sdl2 concise tutorial (4): using SDL_ Image library importing pictures
Darknet training yolov4 record
laravel