NX二次开发 UFUN获得制图中对象的坐标点 UF_DRF_ask_origin
//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;
UF_UI_open_listing_window();
//遍历图纸所有尺寸
tag_t tDimTag = NULL_TAG;
UF_OBJ_cycle_objs_in_part1(UF_PART_ask_display_part(), UF_dimension_type, &tDimTag);//遍历所有尺寸
while (tDimTag != NULL_TAG)
{
//获得尺寸的坐标点
double origin[3];
UF_DRF_ask_origin(tDimTag, origin);
char msg[257];
sprintf_s(msg, "X:%f,Y:%f", origin[0], origin[1]);
UF_UI_write_listing_window(msg);
UF_OBJ_cycle_objs_in_part1(UF_PART_ask_display_part(), UF_dimension_type, &DimTag);
}
UF_terminate();
}