进入块UI样式编辑器做出如下界面:
在Create_Block::apply_cb()函数中添加的代码:
{ //---- Enter your callback code here ----- UF_initialize(); //布尔运算 UF_FEATURE_SIGN sign01=UF_NULLSIGN; //定点坐标 Point3d Point3d01=point0->Point(); double corner_pt01[3]={Point3d01.X,Point3d01.Y,Point3d01.Z}; //长宽高赋值 double dou01[3]={ 0.0,0.0,0.0}; char l[128],w[128],h[128]; char *edge_len01[3]={l,w,h}; dou01[0]=expression0->Value(); dou01[1]=expression01->Value(); dou01[2]=expression02->Value(); for (int i=0;i<3;i++) { sprintf(edge_len01[i],"%lf",dou01[i]); } //tag初始化 tag_t blk_obj_id01=NULL_TAG; //创建块 UF_MODL_create_block1(sign01,corner_pt01,edge_len01,&blk_obj_id01); UF_terminate(); }
运行结果: