iCAx开思网

标题: CreateFace和GetSurface出错 [打印本页]

作者: leihaizhe    时间: 2012-11-22 20:51
标题: CreateFace和GetSurface出错
        CATIBRepAccess* pEdgeCurve = NULL;
       HRESULT hr = ppSelection->QueryInterface(IID_CATIBRepAccess,(void**) &pEdgeCurve);
        if(pEdgeCurve == NULL)
       {
            cout<<"Error in pEdgeCurve"<<endl;
            _pPoint2Agent->InitializeAcquisition();
            return FALSE;
       }
        CATBody_var spBodyTest = pEdgeCurve->CreateBody(spSpecObject2,iBRepType);
        JingmianBody = spBodyTest;


        //将CATBody转换为CATSurface
        CATOrientation helloOrientation(CATOrientationUnknown );
        CATOrientation ioOrientation[1];
        ioOrientation[0] = helloOrientation;
        CATFace *JingFace = JingmianBody->CreateFace();
        JINGSurface = JingFace->GetSurface(ioOrientation);


        //显示
        CATBaseUnknown_var AAAA = NULL_var;
        AAAA = JINGSurface;
        CATISpecObject_var SpecObject = AAAA;
        SpecObject->Update();
        CATIGSMProceduralView_var aaaSpecObject = SpecObject;
        aaaSpecObject->InsertInProceduralView();

ppSelection是一个通过对话框选中的一个CATSurface类型曲面。

编译没有错误,但是运行CATIA的时候会出错,我发现出错的地方在       
CATFace *JingFace = JingmianBody->CreateFace();
JINGSurface = JingFace->GetSurface(ioOrientation);
这两句没有真正生成成功,所以我想问一下,到底是怎么回事?
如果知道问题所在,还请不吝赐教!!!





欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3