iCAx开思网

标题: 还是测量质量的问题,想实现批量测量质量的功能,装配中 打印出图号 图号后面备注... [打印本页]

作者: HUOBAIQING    时间: 2020-6-1 19:54
标题: 还是测量质量的问题,想实现批量测量质量的功能,装配中 打印出图号 图号后面备注...
还是测量质量的问题,想实现批量测量质量的功能,装配中 打印出图号 图号后面备注测量的组件质量,UF_MODL_ask_mass_props_3d(bodyTAG,第一个参数报错,无解呀,哪位大神看一下!初学二次开发,实在弄不明白了。
//---- Enter your callback code here -----
                //获取体
        PropertyList*  bodySelect0Props = selection0->GetProperties();
        std::vector<NXOpen::TaggedObject *> bodys = bodySelect0Props->GetTaggedObjectVector("SelectedObjects");
        delete bodySelect0Props;
        bodySelect0Props = NULL;



                UF_initialize();
                UF_UI_open_listing_window();
                char msg[256], msg1[256];
                                double acc_val[11]={.01,0,0,0,0,0,0,0, 0, 0,0};
                double density, massprop[47];
                double massprop_stat[13];
                int i;

                //得到体的TAG
                for (i = 0; i < bodys.size(); i++)
                {
                        tag_t bodyTAG =bodys[i]->Tag();
        //                tag_t* badyt=NULL;
                        UF_MODL_ask_mass_props_3d(bodyTAG,i,1,3,7.8,1,acc_val,massprop,massprop_stat);       
                      sprintf( msg, "%d", bodyTAG);
                        sprintf( msg1, "%d", massprop);
                        UF_UI_write_listing_window("体的TAG:");
                        UF_UI_write_listing_window(msg);
                        UF_UI_write_listing_window("\n");
                        UF_UI_write_listing_window("体的质量:");
                        UF_UI_write_listing_window(msg1);
                        UF_UI_write_listing_window("\n");
        //                UF_free(badyt);
                }





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