NX secondary development -UFUN paper size value read UF_DRF_ask_dimension_text

Today found UF_DRF_ask_dim_info This can not be read with a text size of attachments, additional text dim_info-> text_info-> text-> full_string; is read out additional text, size is not a value, then a brother QQ group

Tell me UF_DRF_ask_dimension_text use this function to read. I also tested it, and indeed can be read.

 1 NX11+VS2013
 2 
 3 #include <uf.h>
 4 #include <uf_ui.h>
 5 #include <uf_part.h>
 6 #include <uf_draw.h>
 7 #include <uf_drf.h>
 8 #include <uf_obj.h>
 9 
10 
11 UF_initialize();
12 
13 //获得图纸页数量和tag
14 int num_drawings = NULL_TAG;
15 tag_p_t drawing_tags = NULL_TAG;
16 UF_DRAW_ask_drawings(&num_drawings, &drawing_tags);
17 
18 for (int i = 0 ; I <num_drawings; I ++ )
 . 19  {
 20 is      // Open the drawing sheet 
21 is      UF_DRAW_open_drawing (drawing_tags [I]);
 22 is  
23 is      // iterate over all size 
24      NXString ExpName;
 25      String FeatureExpNameStr;
 26 is      String StrRight;
 27      tag_t dimTag = NULL_TAG;
 28      the while (! (UF_OBJ_cycle_objs_in_part1 (UF_PART_ask_display_part (), UF_dimension_type, & dimTag)) && dimTag)
 29      {
 30          // Get the value of the size 
31 is          int dim_subtype = 0 ;
32         double dim_origin[3];
33         UF_DRF_dim_info_p_t dim_info;
34         UF_DRF_ask_dim_info(dimTag, &dim_subtype, dim_origin, &dim_info);
35         string DimValue = dim_info->text_info->text->full_string;
36 
37         //打印
38         uc1601(DimValue.c_str(), 1);
39 
40         //获取尺寸值
41         int num_main_text = 0;
42         char** main_text;
43         int num_dual_text = 0;
44 is          char ** dual_text;
 45          UF_DRF_ask_dimension_text (dimTag, & num_main_text, & main_text, & num_dual_text, & dual_text);
 46 is  
47          // print 
48          uc1601 (main_text [ 0 ], . 1 );    
 49      }
 50  }
 51 is  
52 is  UF_terminate ();
 53 is  
54 is  Caesar Lu Shangyu
 55 December 8, 2019

 

 

Guess you like

Origin www.cnblogs.com/nxopen2018/p/12006281.html