iCAx开思工具箱

标题: 求助,如何将CATCurve转换成CATISpecObject [打印本页]

作者: Cruise_yu    时间: 2015-8-20 14:46
标题: 求助,如何将CATCurve转换成CATISpecObject
CATEdgeCurve  * pCurve_1 = pEdge_1->GetCurve();
CATEdgeCurve  * pCurve_2 = pEdge_2->GetCurve();
CATCurve_var spCurve_1 = NULL_var;
CATCurve_var spCurve_2 = NULL_var;
pCurve_1->QueryInterface(IID_CATCurve,(void**)&spCurve_1);
pCurve_2->QueryInterface(IID_CATCurve,(void**)&spCurve_2);
CATIGSMBlend_var  spBlend  = spGSMFactory -> CreateBlend ();
spBlend ->SetCurve(CATGSMBlendStartLimit,spCurve_1);
spBlend ->SetCurve(CATGSMBlendEndLimit,spCurve_2);
作者: Cruise_yu    时间: 2015-8-21 15:48
CATIGSMSplit_var  spSplit1 = spGSMFactory -> CreateSplit (spTranslate1,iMarkPRSpecObj[5],Orientation1);//分割
spSplit1->QueryInterface(CATIGeometricalElement::ClassId(),(void**)&piGeomElem_1);//pPrtContainer
CATBody_var spBody_1;
spBody_1 = piGeomElem_1->GetBodyResult();
CATLISTP(CATCell) AllEdges_1;
CATLISTP(CATCell) ListEdge ;
spBody_1->GetAllCells(AllEdges_1, 1);
CATCell_var spEdgeCell = AllEdges_1[6];
  CATISpecObject * pSpecObjOnPad = NULL ;
  HRESULT hr_12 = spSplit1->QueryInterface(IID_CATISpecObject,(void**) &pSpecObjOnPad);
    if ( SUCCEEDED(hr_12) )
  {
     CATISpecObject * pFatherPad = NULL ;
     pFatherPad = pSpecObjOnPad->GetFather();

     pSpecObjOnPad->Release();
     pSpecObjOnPad = NULL ;

     if ( pFatherPad != NULL )
     {
         
        CATIBodyRequest * pBodyRequestOnTool = NULL ;
        hr = pFatherPad->QueryInterface(IID_CATIBodyRequest,(void**) &pBodyRequestOnTool);

        pFatherPad->Release();
        pFatherPad = NULL ;

        CATBaseUnknown_var FeatureResult ;
        if ( SUCCEEDED(hr) )
        {
            
           CATLISTV(CATBaseUnknown_var) ListR ;
           pBodyRequestOnTool->GetResults("",ListR);
           
           if ( ListR.Size() >= 1 )
           {
              FeatureResult = ListR[1] ;
           }
           pBodyRequestOnTool->Release();
           pBodyRequestOnTool = NULL ;
        }
         
               
                  CATIGeometricalElement_var FeatureResultGeomElt = FeatureResult ;
                  CATIBRepAccess_var BRepEdge1 = CATBRepDecode(spEdgeCell,FeatureResultGeomElt);

                if ( NULL_var != BRepEdge1 )
                {
                   CATIFeaturize_var FCell = BRepEdge1 ;
                   if ( NULL_var != FCell )
                   {
                      CATISpecObject_var MFEdge1Cell = FCell->FeaturizeF();
                     
                   }
                }
         }
  }

作者: Cruise_yu    时间: 2015-8-21 15:50
能帮我看看,我是哪里有问题么,我是想获得分割后该面的一个边,想获得CATISpecObject类型的边




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