秋爱 发表于 2015-11-27 00:24:00

结合中遇到的问题

本帖最后由 秋爱 于 2015-11-27 00:27 编辑

请问怎么把NXOPEN创建的直线用UF的函数生成管道呢。我在界面上能获取任意两点生成直线(nxopen实现的),把直线转换成UF函数里边的参数后管道不能创建,请求帮助,代码如下:
            //两点创建直线
         
                Session *theSession = Session::GetSession();
                Part *workPart(theSession->Parts()->Work());
                Part *displayPart(theSession->Parts()->Display());

                std::vector<TaggedObject*>pp = point0->GetSelectedObjects();    //获取选择的点
                TaggedObject * p = pp;
                Point * getpoint = dynamic_cast<Point*>(p);


                std::vector<TaggedObject*>qq = point1->GetSelectedObjects();    //获取选择的点
                TaggedObject * p1 = qq;
                Point * getpoint1 = dynamic_cast<Point*>(p1);


                Features::AssociativeLine *nullFeatures_AssociativeLine(NULL);
                Features::AssociativeLineBuilder *associativeLineBuilder1;
                associativeLineBuilder1 = workPart->BaseFeatures()->CreateAssociativeLineBuilder(nullFeatures_AssociativeLine);


                Unit *unit1;
                unit1 = associativeLineBuilder1->Limits()->StartLimit()->Distance()->Units();
                associativeLineBuilder1->Limits()->StartLimit()->Distance()->SetRightHandSide("0");
                associativeLineBuilder1->Limits()->EndLimit()->SetLimitOption(GeometricUtilities::CurveExtendData::LimitOptionsAtPoint);


                associativeLineBuilder1->StartPoint()->SetValue(getpoint);
                associativeLineBuilder1->SetStartPointOptions(Features::AssociativeLineBuilder::StartOptionPoint);
                associativeLineBuilder1->EndPoint()->SetValue(getpoint1);
                associativeLineBuilder1->SetEndPointOptions(Features::AssociativeLineBuilder::EndOptionPoint);
                NXObject *nXObject1;
                nXObject1 = associativeLineBuilder1->Commit();
                associativeLineBuilder1->Destroy();


               
                //uf部分
                UF_initialize();
       
                tag_t linetag =( nXObject1->Tag());
                uf_list_p_t path_list = NULL;
                char * limit [ 2 ] = {"20","0"};
                UF_FEATURE_SIGN sign = UF_NULLSIGN;
                tag_t target_body = null_tag;
                uf_list_p_tfeature_list = NULL;
               
                UF_MODL_create_list(&path_list);
               
                UF_MODL_put_list_item(path_list,linetag);
       
                UF_MODL_create_tube1(path_list,limit,sign,target_body,&feature_list);
               
                errorCode = UF_MODL_delete_list(&path_list);
                UF_MODL_delete_list(&feature_list);
                UF_terminate();
                associativeLineBuilder1->Destroy();

页: [1]
查看完整版本: 结合中遇到的问题