码迷,mamicode.com
首页 > 其他好文 > 详细

转—记录一下获取NC程序名称的方法

时间:2020-01-24 00:07:29      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:其它   遍历   https   rate   mem   程序   stat   static   member   

案例源代码如下:

#include <uf_obj.h>
#include <uf_setup.h>
#include <uf_ncgroup.h>

static logical cycelGenerateCb(tag_t tag, void* data)
{
    logical is_group;
    char name[133];

    UF_CALL(UF_NCGROUP_is_group(tag, &is_group));

    UF_CALL(UF_OBJ_ask_name(tag, name));
    
    UF_UI_write_listing_window(name);
    UF_UI_write_listing_window("\n");
    return TRUE;
}

static void do_it(void)
{
    UF_UI_open_listing_window();

    tag_t setup_tag;
    tag_t program_group;

    UF_CALL(UF_SETUP_ask_setup(&setup_tag));
    UF_CALL(UF_SETUP_ask_program_root(setup_tag, &program_group));
    UF_CALL(UF_NCGROUP_cycle_members(program_group, cycelGenerateCb, NULL));
}
其中,有几点注意一下:

1) 将UF_SETUP_ask_program_root换成UF_SETUP_ask_geom_root或UF_SETUP_ask_mthd_root或UF_SETUP_ask_mct_root,则UF_NCGROUP_cycle_members转而对几何体、加工方法、刀具遍历;

2) 刀具tag的获取也可以用UF_OBJ_cycle_objs_in_part来获得,估计其它项也可以;

本文转自https://www.xuebuyuan.com/478038.html

转—记录一下获取NC程序名称的方法

标签:其它   遍历   https   rate   mem   程序   stat   static   member   

原文地址:https://www.cnblogs.com/liuxiaoqing1/p/12231603.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!