马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
如题,下面是我的代码,iCount是txt文件的个数
for(int i=0; i<iCount; i++)
{
CATIPrtContainer* pPrtCon = NULL;
rc= piNewContainer->QueryInterface( IID_CATIPrtContainer,(void **)&pPrtCon);
if (FAILED(rc) || pPrtCon == NULL) return ;
CATIPrtPart_var spPart=pPrtCon->GetPart();
if(spPart==NULL_var) return ;
CATIMechanicalRootFactory *pSetToolFactory=NULL;
rc=pPrtCon->QueryInterface(IID_CATIMechanicalRootFactory,(void **)& pSetToolFactory);
if(FAILED(rc)|| pSetToolFactory ==NULL) return;
CATISpecObject_var spPRTTool;
spPRTTool= pSetToolFactory->CreatePRTTool("cloud",spPart);
for(int j=0; j<cloudpts[i].size(); j++)
{
CATIGSMFactory_var spGSMFactory; //GSM工厂,创建特征
spGSMFactory = NULL_var;
spGSMFactory = spPart;
CATMathPoint _Point;
float x,y,z;
x=cloudpts[i][j].x; y=cloudpts[i][j].y; z=cloudpts[i][j].z;
_Point.SetCoord(x,y,z);
CATIGSMPoint_var spPoint1 = spGSMFactory->CreatePoint(_Point); //创建一个点
CATIGSMProceduralView_var spSndPntObj = spPoint1;
spSndPntObj->InsertInProceduralView();
}
CATISpecObject_var spSpecObject;
spSpecObject = spGSMFactory;
CATTry spSpecObject->Update();
}
编译没错,但是运行总是出问题,哪位大神帮忙解答一下呗~
|