#include <uf.h>
#include <uf_ui.h>
#include <uf_draw.h>
#include <uf_view.h>
#include <uf_curve.h> UF_initialize(); //在工程图里创建点
double p1[] = { 106.905267, 139.431151 }; //获得图纸页tag
int num_drawings = ;
tag_p_t drawing_tags = NULL_TAG;
UF_DRAW_ask_drawings(&num_drawings, &drawing_tags); //打开图纸页
UF_DRAW_open_drawing(drawing_tags[]); //获得图纸页里的视图tag
int num_views = NULL_TAG;
tag_p_t view_tag = NULL_TAG;
UF_DRAW_ask_views(drawing_tags[], &num_views, &view_tag); //将绘图空间中的点映射到绝对坐标
double model_pt[];
UF_VIEW_map_drawing_to_model(view_tag[], p1, model_pt); //转换
char msg[];
sprintf_s(msg, "%f,%f,%f", model_pt[], model_pt[], model_pt[]); //打印
UF_UI_open_listing_window();
UF_UI_write_listing_window(msg); UF_terminate(); Caesar卢尚宇
2019年11月7日

NX二次开发-UFUN将工程图中的点坐标映射到建模绝对坐标UF_VIEW_map_drawing_to_model-LMLPHP

05-26 13:16