zoukankan      html  css  js  c++  java
  • OPENC函数 UF_UI UF_PART函数(UF_UI_select_with_class_dialog, UF_PART_export_with_options)

    /*主要演示
    UF_PART_export_with_options 这个函数
    */
    1
    //设置class_dialog选择过滤 2 static int init_proc(UF_UI_selection_p_t select,void* user_data) 3 { 4 int num_triples = 1; 5 //实体 片体 6 UF_UI_mask_t mask_triples[] = {UF_solid_type,0,0}; 7 /* enable only lines and edges */ 8 if((UF_UI_set_sel_mask(select,UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,num_triples, mask_triples)) == 0) 9 { 10 return (UF_UI_SEL_SUCCESS); 11 } 12 else 13 { 14 return (UF_UI_SEL_FAILURE); 15 } 16 } 17 extern DllExport void ufsta( char *param, int *returnCode, int rlen ) 18 { 19 /* Initialize the API environment */ 20 if( UF_CALL(UF_initialize()) ) 21 { 22 /* Failed to initialize */ 23 return; 24 } 25 26 /* TODO: Add your application code here */ 27 UF_initialize(); 28 29 //select_with_class_dialog 30 char message[]="类选择对话框"; 31 char title[]="按类选择:"; 32 int scope=UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY; 33 int response=0; 34 int count=0; 35 tag_t* objects=NULL; 36 //export_with_options 37 string part_name="G:\look\123.prt"; 38 tag_t*object_array=NULL; 39 UF_PART_export_options_t options; 40 //多选对话框 41 UF_UI_select_with_class_dialog (message,title,scope,init_proc,NULL,&response,&count,&objects); 42 //分配内存 43 object_array=(tag_t*)malloc(sizeof(tag_t)*count); 44 if (response == UF_UI_OK && count > 0) 45 { 46 for (int i=0; i<count; i++) 47 { 48 object_array[i]=objects[i]; 49 UF_DISP_set_highlight(objects[i], 0); 50 } 51 52 } 53 //新的部件 54 options.new_part=true; 55 //移除参数 56 options.params_mode =UF_PART_remove_params; 57 //复制表达式 58 options.expression_mode=UF_PART_copy_exp_deeply; 59 //导出部件 60 UF_PART_export_with_options (part_name.c_str(),count,object_array,&options); 61 //释放内存 62 free(object_array); 63 UF_free(objects); 64 65 UF_terminate(); 66 67 /* Terminate the API environment */ 68 UF_CALL(UF_terminate()); 69 }

  • 相关阅读:
    Spark面对OOM问题的解决方法及优化总结 (转载)
    spark rdd 宽窄依赖理解
    hive orc update
    hive sql 语句执行顺序及执行计划
    java 正则 贪婪匹配 匹配sql语句中的引号内容
    java 权重随机算法实现
    MySQL创建用户和加限权
    MySQL完整性约束
    MySQL基础操作与数据类型
    MySQL数据库初识
  • 原文地址:https://www.cnblogs.com/zzyfym/p/12076374.html
Copyright © 2011-2022 走看看