NX二次开发-UFUN获取直线的两个端点UF_CURVE_ask_line_data

	NX9+VS2012

	#include <uf.h>
	#include <uf_obj.h>
	#include <uf_ui.h>


	UF_initialize();

	//遍历名字找到直线
	tag_t LineTag = NULL_TAG;
	UF_OBJ_cycle_by_name("MAIN", &LineTag);

	//获取直线的两个端点
	UF_CURVE_line_t LineCoords;
	UF_CURVE_ask_line_data(LineTag, &LineCoords);

	//打印
	char msg[256];
	sprintf_s(msg, "起点:X:%f,Y:%f,Z:%f\n终点:X:%fY:%fZ:%f",LineCoords.start_point[0],LineCoords.start_point[1],LineCoords.start_point[2],
		LineCoords.end_point[0],LineCoords.end_point[1],LineCoords.end_point[2]);
	UF_UI_open_listing_window();
	UF_UI_write_listing_window(msg);

	UF_terminate();

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/lu1287580078/article/details/89285500