qq273531730 发表于 2017-3-19 02:43:54

阿斯蒂芬拉开技术的;弗兰克加强;为搂去玩儿欠妥

sheepboy* 发表于 2017-3-23 23:04:25

#include <stdio.h>#include <uf.h>#include <uf_ui.h>#include <uf_disp.h>#include<uf_modl.h>#include<uf_layer.h>#include<uf_assem.h>#include<uf_obj.h>#include<uf_part.h>#include<iostream>#define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X)))static int report( char *file, int line, char *call, int irc){if (irc){   char    messg;   printf("%s, line %d:%s\n", file, line, call);   (UF_get_fail_message(irc, messg)) ?       printf("    returned a %d\n", irc) :       printf("    returned error %d:%s\n", irc, messg);}return(irc);}static void do_ugopen_api(void){   UF_FEATURE_SIGN sign = UF_NULLSIGN;   tag_t target = NULL_TAG;   double origin [] = {0.0,0.0,0.0};   char* height = "100";   char* cyl_diam = "80";   double cyl_direction [] = {0.0,0.0,1.0};   tag_t cyl_feat_tag = NULL_TAG;   UF_MODL_create_cylinder(sign,target,origin,height,cyl_diam,cyl_direction,&cyl_feat_tag);   double value;   tag_t target1;   UF_MODL_create_exp_tag(height,&target1);//Creates a parameter expression, based upon the input string.   UF_MODL_ask_exp_tag_value(target1,&value);//Asks the value of an expression tag.   double location={0.0,0.0,0.0} ;      double direction [] = {0.0,0.0,1.0};   tag_t obj=null_tag;   char *diam="30";   char *angle="0";   tag_t bottom,top;   tag_t feature_obj_id ;   uf_list_p_t face_list;   UF_MODL_create_list(&face_list);//Retrieves an object from a linked list of objects   UF_MODL_ask_feat_faces(cyl_feat_tag,&face_list);   int count=0;   UF_MODL_ask_list_count(face_list,&count);//Retrieves the count from a linked list of objectsfor(int i=0;i<count;i++){   UF_MODL_ask_list_item(face_list,i,&obj);   int type;   double point ;   double dir ;   double box ;   double radius;   doublerad_data;   intnorm_dir ;   UF_MODL_ask_face_data(obj,&type,point,dir,box,&radius,&rad_data,&norm_dir);//Queries the data associated with a face   if(type==22)//“22”代表有界平面   {         if(fabs(point-origin)<0.0005)         {             bottom=obj;         }         if(fabs(point-value)<0.0001)         {             UF_MODL_ask_feat_location(obj,location);             top=obj;         }   }}UF_MODL_create_simple_hole(location,direction,diam,height,angle,top,bottom,&feature_obj_id);UF_MODL_ask_feat_faces(feature_obj_id,&face_list);UF_MODL_ask_list_count(face_list,&count);for(int i=0;i<count;i++){   UF_MODL_ask_list_item(face_list,i,&obj);//Retrieves an object from a linked list of objects   int typel;   UF_MODL_ask_face_type(obj,&typel);   //倒圆角   if(typel== UF_MODL_CYLINDRICAL_FACE )   {         uf_list_p_t facesl;         UF_MODL_create_list(&facesl);         UF_MODL_ask_shared_edges(top,obj,&facesl);         const char * radius="3";         int smooth_overflow=0;         int cliff_overflow=0;         int notch_overflow=0;         double vrb_tool=3;         tag_t feature_obj_idl;         UF_MODL_create_blend(radius, facesl, smooth_overflow, cliff_overflow, notch_overflow, vrb_tool, &feature_obj_id );      }   }}void ufusr(char *param, int *retcode, int param_len){if (!UF_CALL(UF_initialize())){    do_ugopen_api();    UF_CALL(UF_terminate());}}int ufusr_ask_unload(void){return (UF_UNLOAD_IMMEDIATELY);}

张e沫 发表于 2017-3-25 11:26:20

很好的一段,正好解决了心中的一些疑惑

jangy171341072 发表于 2017-3-28 03:21:52

看一下思路如何

heyuewen 发表于 2017-3-30 13:40:43

看一下思路如何

高山流水瀑布 发表于 2017-4-6 16:12:47

看一下思路如何

管山东 发表于 2017-4-7 11:35:37

这个貌似不太好学啊

叶秋1219 发表于 2017-4-27 11:11:49

感谢分享

Seasonwindy 发表于 2017-4-28 11:31:00

~~~~~~~~~~~~~~~~~~~~~~~~~

wangjiafu* 发表于 2017-4-29 14:56:14

nuz4
页: 8 9 10 11 12 13 14 15 16 17 [18] 19 20 21 22 23 24 25 26 27
查看完整版本: 讲一个UGCAM二次开发中创建操作的函数写法