zoukankan      html  css  js  c++  java
  • NX CAM 二次开发获得当前选择的加工坐标系(MCS)的原点和矩阵的方法

    CAM API 获得当前选择的加工坐标系(MCS)的原点和矩阵的方法

    如图所示:

    代码方法:

     1 int count=0;
     2 tag_t * objects = NULL;
     3 UF_UI_ONT_ask_selected_nodes(&count, &objects);
     4 if(count>0)
     5 {
     6     tag_t value=NULL_TAG;
     7     UF_PARAM_ask_tag_value(objects[0], UF_PARAM_MCS, &value);
     8  
     9     tag_t matrix_id=NULL_TAG;
    10     double csys_origin [ 3 ];
    11     UF_CSYS_ask_csys_info(value, &matrix_id, csys_origin);
    12  
    13     double matrix_values[9];
    14     UF_CSYS_ask_matrix_values(matrix_id, matrix_values);
    15  
    16     char msg[256];
    17     sprintf(msg, "当前选中的MCS原点为:%f, %f, %f
    
    ", csys_origin[0], csys_origin[1], csys_origin[2]);
    18     UF_UI_open_listing_window();
    19     UF_UI_write_listing_window(msg);
    20  
    21     sprintf(msg, "当前选中的MCS矩阵为:
    %f, %f, %f,
    %f, %f, %f, 
    %f, %f, %f
    
    ",
    22                         matrix_values[0], matrix_values[1], matrix_values[2],
    23                         matrix_values[3], matrix_values[4], matrix_values[5],
    24                         matrix_values[6], matrix_values[7], matrix_values[8]);
    25  
    26     UF_UI_write_listing_window(msg);
    27 }
  • 相关阅读:
    Flink Flow
    Excellent JD
    Storm Flow
    Fundmentals in Stream Computing
    SpringBoot
    Generic/Template Programming in Flink
    Talks on C/S
    Thrift-RPC client in Flume
    Aysnc-callback with future in distributed system
    Unity Shader入门教程(二)最基本的Diffuse和Normal样例
  • 原文地址:https://www.cnblogs.com/ugapi/p/12774032.html
Copyright © 2011-2022 走看看