admin 发表于 2018-5-5 08:15:08

CATIA CAA二次开发源码分享:拓扑转特征过程--线



CATIA CAA二次开发源码分享:拓扑转特征过程



CATTopVertex       *pTopVertex = NULL;
   CATBody               *pPtBody1   = NULL;
   CATBody               *pPtBody2   = NULL;
   CATBody               *pLineBody= NULL;
   CATSoftwareConfiguration *pConfig = new CATSoftwareConfiguration ( );
   CATTopData TopData ( pConfig );
   //pPoint = piGeomFactory->CreateCartesianPoint ( Point1 );
   pTopVertex = CATCreateTopVertex ( piGeomFactory, &TopData, Point1 );

   pTopVertex->Run ( );

   pPtBody1 = pTopVertex->GetResult ( );
   //pPoint = piGeomFactory->CreateCartesianPoint ( Point2 );
   pTopVertex = CATCreateTopVertex ( piGeomFactory, &TopData, Point2 );
   pTopVertex->Run ( );
   pPtBody2 = pTopVertex->GetResult ( );
   pLineBody = ::CATCreateTopLineFromPoints ( piGeomFactory, &TopData, pPtBody1, pPtBody2 );
///////////////实例化
   CATIDatumFactory_var spDatum=NULL_var;
                                        CATISpecObject * piDatumFeature=NULL;
//CATISpecObject_var spOutDatumFeature=NULL_var;
rc=piRootContainer->QueryInterface(IID_CATIDatumFactory, (void**) &spDatum);
if(SUCCEEDED(rc))
{
   ::MessageBox(NULL,(CString)("IID_CATIDatumFactory成功"),_T("提示"),MB_OK|MB_ICONWARNING);
}
                rc=spDatum->InstanciateDatum(pLineBody,piDatumFeature);
                if(SUCCEEDED(rc))
{
   ::MessageBox(NULL,(CString)("实例化成功"),_T("提示"),MB_OK|MB_ICONWARNING);
}else
{
   ::MessageBox(NULL,(CString)("实例化不成功"),_T("提示"),MB_OK|MB_ICONWARNING);
}
CATISpecObject_var spObjectFromBody=piDatumFeature;
                spObjectFromBody->Update();      

               
                CATIGSMProceduralView_var spPntObj=NULL_var;
                spPntObj = spObjectFromBody;
                spPntObj->InsertInProceduralView();

页: [1]
查看完整版本: CATIA CAA二次开发源码分享:拓扑转特征过程--线