iCAx开思工具箱

标题: 我选择的平面,用于投影时为什么是空的 [打印本页]

作者: lansehaiyu    时间: 2012-11-15 10:04
标题: 我选择的平面,用于投影时为什么是空的
我想选择如下图所示的平面,以下是我的程序 (, 下载次数: 4)

CATBaseUnknown * pSelectPlane=_pSelectPlaneAgent->GetElementValue(_pSelectPlaneAgent->GetValue());
CATPlane * spPlane = NULL;
rc=pSelectPlane->QueryInterface(IID_CATPlane,(void **)& spPlane);
if (SUCCEEDED(rc))
{
  cout<<"通过选取对象查询CATPlane成功,选取对象是平面"<<endl;
  pSelectPlane->Release();
  pSelectPlane=NULL;
  CATPlane_var spPlaneTem = spPlane;
  CATIFeaturize_var spRPlaneSpec = spPlaneTem;
  CATISpecObject_var SpecPlane=NULL_var;
  SpecPlane=spRPlaneSpec->FeaturizeF(MfDuplicateFeature | MfPermanentBody | MfSelectingFeatureSupport | MfFunctionalFeaturization );
  if (NULL_var !=SpecPlane)
  {
  cout<<"将选取的平面转化为特征数据成功!!!"<<endl;
   SelectPlaneObject=SpecPlane;  
}
}

选择的这个平面用于做投影平面时
CATIGSMProject_var _pGSMProject = NULL_var;
  _pGSMProject = pGSMProjection->CreateProject(_spSurfaceBoundary,SelectPlaneObject,pGSMDir,TRUE,CATGSMAllSolutions);
  if (NULL_var==_pGSMProject)
  {
   cout<<"通过CATIGSMFactory接口函数CreateProject创建投影曲线失败!!!"<<endl;
   return FALSE;
  }
运行后的结果这个平面仍然没有选中,请问是我上面选择的平面有问题吗?

作者: linlily0925    时间: 2012-11-15 17:03
你的平面在结构树上实际存在,就不需要通过拓扑转换~~
CATBaseUnknown * pSelectPlane=_pSelectPlaneAgent->GetElementValue();
CATISpecObject_var spSpecPlane = pSelectPlane;



就可以了~~Ni试试~~~





欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3