NX二次开发 UFUN在图纸中添加视图 UF_DRAW_import_view
//NX8.0+VS2010
#include <uf_assem.h>
#include <uf_part.h>
#include <uf_obj.h>
#include <uf_modl.h>
#include <uf_view.h>
#include <uf_draw.h>
extern DllExport void ufsta(char* param, int* returnCode, int rlen)
{
if (UF_initialize())
return;
//新建工程图(A4图纸)
char* sDrawingName = "Sheet1";//设置图纸名字
UF_DRAW_info_t drawing_Info;//设置图纸大小、投影视角、视图比例等
drawing_Info.size_state = UF_DRAW_METRIC_SIZE;//设置图纸类型
drawing_Info.size.metric_size_code = UF_DRAW_A4;//设置图纸大小
drawing_Info.drawing_scale = 1.0;//设置比例
drawing_Info.units = UF_PART_METRIC;//设置单位
drawing_Info.projection_angle = UF_DRAW_FIRST_ANGLE_PROJECTION;//设置投影视角
tag_t tDrawingTag = NULL_TAG;
UF_DRAW_create_drawing(sDrawingName, &drawing_Info, &tDrawingTag);
//导入视图(创建Top视图)
//找名字获取视图的Tag
tag_t tTopViewTag = NULL_TAG;
UF_OBJ_cycle_by_name_and_type(UF_PART_ask_display_part(), "Top", UF_view_t