|
贴上代码
- tag_t Link_drawing_tag;
- char* Link_drawing_name = "_model1"; //图纸标签
- UF_DRAW_info_t drawing_info; //图纸信息
- UF_DRAW_metric_size_e drawsize;
- drawsize = UF_DRAW_A0; //图纸大小
- UF_DRAW_size_union_u drawunion;
- drawunion.metric_size_code = drawsize;
- drawing_info.size_state = UF_DRAW_METRIC_SIZE;
- drawing_info.size = drawunion;
- drawing_info.drawing_scale = 1; //设置比例
- drawing_info.units = 1; //设置单位
- drawing_info.projection_angle = UF_DRAW_FIRST_ANGLE_PROJECTION;
- UF_CALL(UF_DRAW_create_drawing(Link_drawing_name, &drawing_info, &Link_drawing_tag));
- UF_CALL(UF_DRAW_ask_drawing_info(Link_drawing_tag, &drawing_info));
- UF_CALL(UF_DRAW_open_drawing(Link_drawing_tag));
- double reference_point[2] = { 70.0,160.0 };
- tag_t drawing_tag = NULL_TAG;
- tag_t part_tag = NULL_TAG;
- tag_t view_tag = NULL_TAG;
- tag_t draw_view_tag = NULL_TAG;
- char *view_name = " BOTTOM";
- UF_DRAW_view_info_t view_info;
- view_info.view_scale = UF_DRAW_ACTIVE_VIEW;
- view_info.anchor_point = NULL_TAG;
- view_info.view_scale = 1.0;
- view_info.use_ref_pt = FALSE;
- view_info.inherit_boundary = FALSE;
- view_info.transfer_annotation = TRUE;
- UF_DRAW_view_prfs_t view_display_parms;
- part_tag = UF_PART_ask_display_part(); //通过查询函数,得到当前打开模型的标识
- UF_DRAW_ask_current_drawing(&drawing_tag); //查询当前图纸的标识
- UF_CALL(UF_OBJ_cycle_by_name(view_name, &view_tag));
- UF_CALL(UF_DRAW_import_view(drawing_tag, view_tag, reference_point, &view_info, &draw_view_tag));
- //创建俯视图函数
- UF_CALL(UF_DRAW_set_view_display(drawing_tag, &view_display_parms));
- //设置视图的显示
- UF_DRAW_update_one_view(drawing_tag, draw_view_tag);
- //更新视图的显示函数
复制代码
运行报错
- +++ Input tag is null.
- UF_DRAW_import_view(drawing_tag, view_tag, reference_point, &view_info, &draw_view_tag);
- *** ERROR code 1405026 at line 120 in NX10_Open_Wizard2.cpp:
- +++ Input tag is not a view.
- UF_DRAW_set_view_display(drawing_tag, &view_display_parms);
复制代码
请求帮助啊 |
|