NX二次开发 UFUN遍历层组 UF_OBJ_cycle_objs_in_part
//NX8.0+VS2010
#include <uf_obj.h>
#include <uf_assem.h>
#include <uf_layer.h>
extern DllExport void ufsta(char* param, int* returnCode, int rlen)
{
if (UF_initialize())
return;
tag_t category_tag = NULL_TAG;
UF_LAYER_category_info_t category_info;
sprintf_s(category_info.name, "%s", "MEILEI_LAYER");//层名
sprintf_s(category_info.descr, "%s", "梅雷666");//层描述
//层范围 10..12
for (int i = 0; i < 256; i++)
category_info.layer_mask[i] = false;
category_info.layer_mask[9] = true;//10
category_info.layer_mask[10] = true;//11
category_info.layer_mask[11] = true;//12
UF_LAYER_create_category(&category_info, &category_tag);//创建层组
UF_LAYER_ask_category_tag("MEILEI_LAYER", &category_tag);//根据层名称获得层组tag
if (category_tag)
{
UF_LAYER_edit_category_name(category_tag, "MEILEI_LAYER666");//修改层名
UF_LAYER_edit_