ANSYS80的调用和ansys57类似:
//VC调用ANSYS的示例程序。
//Test.cpp
#include "stdio.h"
#include"process.h"
void main()
{
int result;
printf("Solving...");
result=system("执安装文件路径名+文件名 -b -p ansysul -i test.txt -o test.out");
printf("Solution finished...");
}
产品特征代码在ANSYS帮助电子文档(help>ansys documentation)里可以找到,路径如下:
ansys8.0 documentation>ansys,Inc. Licensing Guide>License files>Product Variable Table
以该表的第一行为例,如果你的ANSYS是multiphysics版本,那么对应的产品特征代码为ane3fl,则:
result=system("安装文件路径名+文件名 -b -p ane3fll -i test.txt -o test.out");
这里一定要注意VC执行文件路径写法:
第一种:
"C:\\Program Files\\Ansys Inc\\v80\\ANSYS\\BIN\\INTEL\\ANSYS80.exe"
"C:\\ANSYS80.exe"
但是这样还不可以
我把原文件考到C:\目录下,然后C:\\ANSYS80.exe。
第二种:
::WinExec("C:\\Program Files\\Ansys Inc\\v80\\ANSYS\\BIN\\INTEL\\ANSYS80.exe -b -p anfl -i C:\\test.txt -o C:\\test.out", SW_SHOWNORMAL);
来自阳光精品论坛