NX二次开发 UFUN打开或关闭栅格定位 UF_DISP_set_grid_parameters
#include <uf_disp.h>
BOOL OpenGridPosition(double grid_unit)
{//打开栅格定位
UF_DISP_grid_t grid;
if (grid_unit<0.0001)
return FALSE;
UF_DISP_ask_grid_parameters(UF_DISP_MODEL_GRID, &grid);
grid.show_grid = 0;
grid.snap_to_grid = true;
grid.grid_type = UF_DISP_RECTANGULAR_GRID;
grid.grid_unit_x =grid_unit;
grid.grid_unit_y =grid_unit;
grid.grid_line_every_x = 1;
grid.grid_line_every_y = 1;
grid.grid_emphasis_every_x = 1;
grid.grid_emphasis_every_y = 1;
UF_DISP_set_grid_parameters(UF_DISP_MODEL_GRID, &grid);
return TRUE;
}
BOOL CloseGridPosition(void)
{//关闭栅格定位
UF_DISP_grid_t grid ;
grid.show_grid = 0;
grid.snap_to_grid = false;
grid.grid_type