iCAx开思网
标题:
CAA: 和CATIA v5 R11 CATIA v5 R13中Draft的复制问题
[打印本页]
作者:
wgbin2100
时间:
2005-11-11 10:16
标题:
CAA: 和CATIA v5 R11 CATIA v5 R13中Draft的复制问题
本人做了一个程序,在CATIA v5 R11中可以进行复制视图,但到了CATIA v5 R13就不行了,总是提示我 command interruput,请高手指点!!!
主要代码如下:
CATListValCATISpecObject_var spViewToPasteList=spSheet1->GetViewList();
CATICutAndPastable_var spSrcCCP(CATISpecObject_var(spSheet1)->GetFeatContainer());
CATICutAndPastable_var spTarCCP(CATISpecObject_var(spSheet2)->GetFeatContainer());
IdFormat MyFmy ="CATDrwCont" ;
const CATFormat* pFmt = CATFormat::GetRegisteredFormat(MyFmy);
ListOfVarBaseUnknown newListToCopy;
ListOfVarBaseUnknown listFromCopy;
for ( int j = 1; j<=spViewToPasteList.Size(); j++)
{
CATIView_var(spViewToPasteList[j])->SetViewType(Main_View);
listFromCopy.Append(spViewToPasteList[j]);
listPastedObjects= spTarCCP -> Paste (extractedListToCopy,&listTargetObjects ,pFmt);
CATISketch_var spSkech =(CATIView_var(spViewToPasteList[j]))->GetSketch();
CATIDescendants_var spDes(spSkech);
if (!spDes)
{
cout << "No CATIDecendants Interface." << endl;
}
else
{
CATListValCATISpecObject_var listChildren;
spDes->GetAllChildren("CATIDrwText", listChildren); //"CATISpecObject"
int c = listChildren.Size();
for (int i = 1; i<=c; i++) ((CATIDrwText_var)listChildren[i])->SetOrientationReference(1);
}
HRESULT rc = spSrcCCP -> BoundaryExtract (newListToCopy, &listFromCopy,pFmt);
ListOfVarBaseUnknown extractedListToCopy;
CATICutAndPastable_var spSrcCCPExt = spSrcCCP -> Extract (newListToCopy, pFmt);
int r = 0;
if (!!spSrcCCPExt) r = spSrcCCPExt->BoundaryExtract(extractedListToCopy, NULL,pFmt);
for( j=1;j<=extractedListToCopy.Size();j++)
{
double ox,oy;
CATIDftViewMakeUp *ViewMU =NULL;
rc=extractedListToCopy[j]->QueryInterface(IID_CATIDftViewMakeUp, (void **)&ViewMU);
if(SUCCEEDED(rc))
{ ViewMU->GetPosition(&ox,&oy);
ViewMU->SetPosition(ox,oy);
}
ListOfVarBaseUnknown listPastedObjects ;
ListOfVarBaseUnknown listTargetObjects ;
listTargetObjects.Append(spSheet2);
listPastedObjects= spTarCCP -> Paste (extractedListToCopy,&listTargetObjects ,pFmt);
}
欢迎光临 iCAx开思网 (https://www.icax.org/)
Powered by Discuz! X3.3