1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_modl.h> 5 #include <uf_part.h> 6 7 8 UF_initialize(); 9 10 //获取当前显示部件的TAG 11 tag_t DisplayTag = UF_PART_ask_display_part(); 12 13 //输入Part的TAG,获取整个部件表达式的TAG和表达式个数 14 int NumberOfExps; 15 tag_t* ExpsTag = NULL_TAG; 16 UF_MODL_ask_exps_of_part(DisplayTag, &NumberOfExps, &ExpsTag); 17 18 //打印 19 char msg[1300]; 20 sprintf(msg, "数量为:%d", NumberOfExps); 21 lw->Open(); 22 lw->WriteLine(msg); 23 24 for (int i = 0; i < NumberOfExps; i++) 25 { 26 sprintf(msg, "TAG为:%d", ExpsTag[i]); 27 lw->WriteLine(msg); 28 } 29 30 //释放内存 31 UF_free(ExpsTag); 32 33 UF_terminate();
NX二次开发-UFUN输入Part的TAG,获取整个部件表达式的TAG和表达式个数UF_MODL_ask_exps_of_part
原文:https://www.cnblogs.com/nxopen2018/p/10975933.html