iCAx开思工具箱
标题:
CATDocumentServices::SaveAs()保存的文件,重新打开里面是空的
[打印本页]
作者:
anlingbin
时间:
2014-11-25 14:08
标题:
CATDocumentServices::SaveAs()保存的文件,重新打开里面是空的
在Catia中,插入-现有部件Part1.igs,这时候有模型,然后调用方法另存为.stl文件,为什么.stl重新打开后是空的,并没有图形,
一下是代码和附件Part1.igs:
CATFrmEditor* pEditor = CATFrmEditor::GetCurrentEditor();
if (pEditor != NULL)
{
CATDocument* doc = pEditor->GetDocument();
//doc->SaveAs("H:\\catia\\workspace\\ads.igs", true);
CATUnicodeString fileName("H:\\catia\\model\\ads2.stl");
HRESULT hr;
hr = CATDocumentServices::SaveAs(*doc, fileName);
if (SUCCEEDED(hr))
{
std::cout << "Document Saved OK!" << std::endl;
}
else
{
std::cout << "Error in saving Document !" << std::endl;
}
}
作者:
cww1234
时间:
2015-1-11 21:09
个人观点:就是手动将igs模型另存成stl文件打开后也是空的,,所以建议另存成其他格式的文件试试~~
比如说将当前方根另存成stp格式文件:
CATFrmEditor * pEditor=CATFrmEditor::GetCurrentEditor();
if (pEditor==NULL)
{
MessageBox (NULL,L"hello",L"获取Editor失败",MB_OKCANCEL);
}
CATDocument *pDoc=pEditor->GetDocument();
CATUnicodeString filename("C:\\Users\\MyPC\\Desktop\\kk.stp");
HRESULT hr;
hr=CATDocumentServices::SaveAs(*pDoc,filename);
if (SUCCEEDED(hr))
cout<<"Document has been saved!"<<endl;
else
cout<<"Failed to save"<<endl;
欢迎光临 iCAx开思工具箱 (https://t.icax.org/)
Powered by Discuz! X3.3