学UG二次开发就上UG网:
C++UG二次开发布尔运算求和函数: UF_MODL_unite_bodies();求和后保留目标体或工具体的函数: UF_MODL_unite_bodies_with_retained_options
UG二次开发
NX二次开发布尔运算求和例题源码:
- /*中磊国际模具培训-创建求和运算*/
- /*学NX二次开发就上UG网-www.9sug.com块参数 */
- double blk_corner[3] = { 0, 0, 0 };
- char * blk_edg_len[3] = { "20", "20", "20" };
- tag_t blk_obj_id;
- tag_t blk_body_id;
- /*学NX二次开发就上UG网-www.9sug.com圆柱参数 */
- double cyl_origin[3] = { 0, 0, 0 };
- char * cyl_height = "20";
- char * cyl_diam = "10";
- double cyl_direction[3]{0, 0, 1};
- tag_t cyl_obj_id;
- tag_t cyl_body_id;
- /*学NX二次开发就上UG网-www.9sug.com块参数 */
- UF_MODL_create_block1(UF_NULLSIGN, blk_corner, blk_edg_len, &blk_obj_id);
- UF_MODL_ask_feat_body(blk_obj_id, &blk_body_id);
- /*学NX二次开发就上UG网-www.9sug.com圆柱参数 */
- UF_MODL_create_cyl1(UF_NULLSIGN, cyl_origin, cyl_diam,cyl_height,cyl_direction, &cyl_obj_id);
- UF_MODL_ask_feat_body(cyl_obj_id, &cyl_body_id);
- /*调整视图到合适大小*/
- tag_t view_tag = NULL_TAG;
- UF_VIEW_ask_work_view(&view_tag);
- UF_VIEW_fit_view(view_tag, 0.7);
- /*布尔运算-加*/
- UF_MODL_unite_bodies(blk_body_id, cyl_body_id);
- /* Terminate the API environment */
复制代码 作业:
NX二次开发学习者可以根据提供的求和保留工具体函数,创建两零件执行布尔运算后保留工具体或目标体的例子。
|