UF_initialize(); //遍历所有尺寸 int type = 0; tag_t DimTag = NULL_TAG; UF_OBJ_cycle_objs_in_part1(UF_PART_ask_display_part(), UF_dimension_type, &DimTag);//遍历所有尺寸 while (DimTag != NULL_TAG) { //获取尺寸的值 int dim_subtype = 0;//尺寸的类型 double dim_origin[3];//原点坐标 UF_DRF_dim_info_p_t dim_info; UF_DRF_ask_dim_info(DimTag, &dim_subtype, dim_origin, &dim_info); string DimValue = dim_info->text_info->text->string; //打印 uc1601(DimValue.c_str(), 1); UF_OBJ_cycle_objs_in_part1(UF_PART_ask_display_part(), UF_dimension_type, &DimTag); } UF_terminate(); Caesar卢尚宇 2019年7月4日
2019年12月8日
今天发现UF_DRF_ask_dim_info这个函数不能读带附件文本的尺寸,有附加文本dim_info->text_info->text->full_string;读出来的是附加文本内容,并不是尺寸的值,后来QQ群的一位兄弟
告诉我要用UF_DRF_ask_dimension_text这个函数去读。我也测试了一下,确实可以读。https://www.cnblogs.com/nxopen2018/p/12006281.html