创建基本视图

	//创建图纸页(ufun的方法,无法使用模板)
	UF_DRAW_info_t drawing_info;
	drawing_info.size_state = UF_DRAW_METRIC_SIZE;
	drawing_info.size.metric_size_code = UF_DRAW_A3;
	drawing_info.drawing_scale = 1;
	drawing_info.units = UF_PART_METRIC;
	drawing_info.projection_angle = UF_DRAW_FIRST_ANGLE_PROJECTION;
	tag_t drwa_TAG;
	UF_DRAW_create_drawing("draw", &drawing_info, &drwa_TAG);

	//获得俯视图TAG
	tag_t viewTAG = NULL_TAG;
	UF_OBJ_cycle_by_name_and_type(UF_ASSEM_ask_work_part(), "TOP", UF_view_type, false, &viewTAG);

	//初始化视图信息结构
	UF_DRAW_view_info_t view_info;
	UF_DRAW_initialize_view_info(&view_info);

	//导入视图到当前图纸页
	double dwg_point[2] = { 100, 100 };
	tag_t draw_view_tag;
	UF_DRAW_import_view(drwa_TAG, viewTAG, dwg_point, &view_info, &draw_view_tag);

	//更新图纸页上的单个视图成员
	UF_DRAW_update_one_view(drwa_TAG, draw_view_tag);

创建基本视图_第1张图片

 

你可能感兴趣的:(NX/UG二次开发,c++)