iCAx开思工具箱
标题:
CAA 对象特殊粘贴
[打印本页]
作者:
daiff2008
时间:
2010-12-1 15:06
标题:
CAA 对象特殊粘贴
CATICutAndPastable_var spStartCAPOnPrtCont(piPrtContainerOnRoot);
CATLISTV(CATBaseUnknown_var) listTargets;
CATISpecObject_var spSourcePart = NULL_var;
spSourcePart = piPrtCont->GetPart();
CATPathElement *pathTarget = new CATPathElement(spSourcePart);
listTargets.Append(pathTarget);
pathTarget->Release();
if (spStartCAPOnPrtCont == NULL_var)
{
cout<<"spStartCAPOnPrtCont == NULL_var"<<endl;
}
CATLISTP(CATFormat) ListFormat = spStartCAPOnPrtCont-> ListPasteFormats();
cout<<"ListFormat.Size() = "<<ListFormat.Size()<<endl;
int FormatCount = 0;
for (FormatCount = 1;FormatCount <= ListFormat.Size();FormatCount++)
{
cout<<"CATFormat's Name = "<<(ListFormat[FormatCount])->Name()<<endl;
}
IdFormat MyFmy ="CATPrtResultWithOutLink" ;
const CATFormat* pFmt = CATFormat::GetRegisteredFormat(MyFmy);
CATLISTV(CATBaseUnknown_var) listObjectsToCopy;
listObjectsToCopy.Append(spMechanicalTool);
CATLISTV(CATBaseUnknown_var) listObjectsAlreadyInBoundary;
int resultat = spStartCAPOnPrtCont->BoundaryExtract(listObjectsAlreadyInBoundary,
&listObjectsToCopy,
pFmt);
cout<<"listObjectsAlreadyInBoundary.Size = "<<listObjectsAlreadyInBoundary.Size()<<endl;
CATBaseUnknown_var spEltCopy = spStartCAPOnPrtCont->Extract(listObjectsAlreadyInBoundary,
pFmt);
CATICutAndPastable_var spCAPOnEltCopy(spEltCopy);
CATLISTV(CATBaseUnknown_var) listObjects;
int resultat2 = spCAPOnEltCopy->BoundaryExtract(listObjects,NULL,pFmt);
CATICutAndPastable_var spEndCAPOnPrtCont(piPrtCont);
CATLISTV(CATBaseUnknown_var) spFinalObject = spEndCAPOnPrtCont->
aste(listObjectsAlreadyInBoundary,
NULL,
pFmt);
上述代码是对象的特殊粘贴 但不成功 请教各位高手!
作者:
daiff2008
时间:
2010-12-1 15:08
IdFormat MyFmy ="CATPrtResultWithOutLink" ;//特殊粘贴
const CATFormat* pFmt = CATFormat::GetRegisteredFormat(MyFmy);
是不是进行特殊粘贴? 俺试过就是没有成功!
作者:
xkgb
时间:
2010-12-19 09:29
路过,学学
作者:
歆韵
时间:
2010-12-22 09:40
换个粘贴的方法,用CATIMmrInterPartCopy类,下面有SetLinkMode()的方法
作者:
goodtings
时间:
2012-8-1 22:33
楼主,请问这个问题解决了吗?我也遇到同样的问题了。
欢迎光临 iCAx开思工具箱 (https://t.icax.org/)
Powered by Discuz! X3.3