|
求助啊!
pfcExceptions::XToolkitGeneralError
是怎么回事啊???
private void button1_Click(object sender, EventArgs e)
{
string workpath = "E:\\W.S.K\\建模练习\\仿真\\";
string exepath = "C:\\Program Files\\PTC\\Creo 2.0\\Parametric\\bin\\";
IpfcAsyncConnection asyncConnection = null;
CCpfcAsyncConnection cAC = null;
IpfcBaseSession session;
cAC = new CCpfcAsyncConnection();
asyncConnection = cAC.Start(exepath + " -g:no_graphics -i:rpc_input", ".");
//asyncConnection = cAC.Start(exepath + "parametric.bat", ".");
session = asyncConnection.Session as IpfcBaseSession;
// 设置工作目录
session.ChangeDirectory(workpath);
// C#进程调用和其它将进行的其它进程
IpfcModelDescriptor descModel;
IpfcModel model;
// 载入工作目录下的 "prt0001.prt" 文件
descModel = (new CCpfcModelDescriptor()).Create((int)EpfcModelType.EpfcMDL_PART, "cl_test.prt", null);
model = session.RetrieveModel(descModel);
} |
|