马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想把工程图中一个SHEET的内容拷到另一个SHEET里,现通过spcurrenView=spcurrentSheet->GetCurrentView();
然后把spcurrentView拷贝到spNewSheet.实现过程如下.
此程序可实现自己画的工程图的拷贝及图框的拷贝。但对于由CATIA的3维图直接生成的2维工程图却不能拷贝,编译可通过,但运行出错“检测到空指针”,请教各位高手,如何入手解决呢?
问题可能是处在,交互产生的工程图,和PART文档之间的连接问题。对否?
请各位指点,多谢了!:)
ListOfVarBaseUnknown newListToCopy;
ListOfVarBaseUnknown listFromCopy;
CATIView_var spView=spSheet1->GetCurrentView();
CATISpecObject_var spViewToPaste(spView);
listFromCopy.Append(spViewToPaste);
result = piCutAndPastableOnSourceCont -> BoundaryExtract (newListToCopy, &listFromCopy,NULL);
if (NULL != result)
{
cout<<"........."<<endl;
}
else
{
cout << "BoundaryExtract failed" << endl << flush;
piCutAndPastableOnSourceCont -> Release();
piCutAndPastableOnTargetCont -> Release();
return 10;
}
VarBaseUnknown pExtractedList;
pExtractedList = piCutAndPastableOnSourceCont -> Extract (newListToCopy, NULL);
piCutAndPastableOnSourceCont -> Release();
piCutAndPastableOnSourceCont = NULL;
CATICutAndPastable *piCutAndPastableOnExtractedList = NULL;
rc = pExtractedList -> QueryInterface(IID_CATICutAndPastable,
(void**) &piCutAndPastableOnExtractedList);
if (FAILED(rc))
{
cout << "ERROR in QueryInterface on CATICutAndPastable on Target Container" << endl ;
return 3;
}
if(piCutAndPastableOnExtractedList)cout<<"piCutAndPastableOnExtractedList!=0"<<endl;
ListOfVarBaseUnknown extractedListToCopy;
result = NULL;
result = piCutAndPastableOnExtractedList -> BoundaryExtract (extractedListToCopy,
NULL,
NULL);
if (NULL != result)
{
cout << "BoundaryExtract from Clipboard succeeded" << endl << flush;
cout << "Number of objects extractedListToCopy= " << extractedListToCopy.Size() << endl;
}
else
{
cout << "BoundaryExtract failed" << endl << flush;
piCutAndPastableOnTargetCont -> Release();
return 10;
}
piCutAndPastableOnExtractedList -> Release();
piCutAndPastableOnExtractedList = NULL;
if(piCutAndPastableOnTargetCont!=NULL)cout<<"piCutAndPastableOnTargetCont!=0"<<endl;
else cout<<"piCutAndPastableOnTargetCont==0"<<endl;
cout << "Number of objects extractedListToCopy= " << extractedListToCopy.Size() << endl;
ListOfVarBaseUnknown listPastedObjects ;
listPastedObjects= piCutAndPastableOnTargetCont -> Paste (extractedListToCopy,NULL,NULL) |