CATVisManager* pVisManager = CATVisManager::GetVisManager();
if ( NULL == pVisManager )
{
cout <<" ERROR by retrieving the CATVisManager instance" << endl;
return 5;
}
for (int i = 1; i <= numberOfProducts; i++)
{
CATIProduct* piProductOnProduct = NULL;
if (SUCCEEDED((*pProductList)[i]->QueryInterface(IID_CATIProduct,(void**)&piProductOnProduct)))
{
if (SUCCEEDED(piProductOnProduct->GetShapeRep(spLinkableOnShapeRep)))
{
//CATDlgNotify * pPromptBox = new CATDlgNotify((CATApplicationFrame::GetApplicationFrame())->GetMainWindow(), "Right", CATDlgNfyInformation);
//pPromptBox->SetTitle(pOccurringError->GetNLSSource());
//pPromptBox->SetText("All have been down,ok!!!");
//pPromptBox->SetVisibility(CATDlgShow);
else
{
cout<<"(NULL == _p3DViewer) Failed!!"<<endl;
return 8;
}
rc = CATDocumentServices::Remove (*pDoc);
if ( FAILED(rc) )
{
cout <<"Deleting the *pDoc failed"<<endl;
return 9;
}
return 0;
}作者: chengongcumt 时间: 2005-9-22 11:48
以下是程序的WORKSPACE文档,请指导!谢谢!!作者: chengongcumt 时间: 2005-9-22 11:54
--------------------------------------------------------------------------------
以下是程序的WORKSPACE文档,请指导!谢谢!!作者: chengongcumt 时间: 2005-9-22 11:55
--------------------------------------------------------------------------------
以下是程序的WORKSPACE文档,请指导!谢谢!!作者: chengongcumt 时间: 2005-9-22 11:56
--------------------------------------------------------------------------------
以下是程序的WORKSPACE文档,请指导!谢谢!!作者: saeba 时间: 2005-9-22 12:06
Very good! You are doing a perfect example!
Could you also tell me the structre of your main product (tree view)?
Anyway, I will look at your code next week.
I have to prepare a training this week, thank you for your understanding.作者: chengongcumt 时间: 2005-9-22 15:02
由于要显示的Product的产品树较大,我将要预览显示的装配文件也发上去吧,其实随便用一个装配文件都可以。谢谢saeba!!祝一切顺利!!作者: chengongcumt 时间: 2005-9-26 08:31
有没有哪位CAA高手能帮忙看看啊?谢谢!saeba兄最近还很忙呢吧。作者: saeba 时间: 2005-9-26 16:19
今天终于找时间看了一下,还没有解决所有问题,但是知道了为什么AttachTo会失败:
其实AttachTo并不是从第4个以后就都失败的,
如果你把
cout <<" ERROR in the AttachTo method" << endl;
return 6;
改成
cout <<" ERROR in the AttachTo method" << endl;
continue;
就会发现,对有些子product是成功的,为什么呢?
仔细看看成功的和失败的,发现,
虽然你的父product下面虽然有42个子product,但是其实有很多都是重复的指向同一个catpart
成功的AttachTo都是对不同的catpart,而失败的都是对已经AttachTo过的
因此,如果你把
CATPathElement* RootObjectPath=new CATPathElement(spLinkableOnShapeRep);
改成
CATPathElement* RootObjectPath=new CATPathElement(piProductOnProduct);
就一个也不会失败了,因为每个子product都是不同的