zoukankan      html  css  js  c++  java
  • NX二次开发-UFUN获取点集里的点数量和所有点tag UF_MODL_ask_points_parms

    NX9+VS2012
    
    #include <uf.h>
    #include <uf_curve.h>
    #include <uf_modl.h>
    #include <uf_ui.h>
    
    
    
    UF_initialize();
    
    //创建点
    double pointCoords1[3] = {0,10,20}; 
    tag_t point1Tag = NULL_TAG;
    UF_CURVE_create_point(pointCoords1, &point1Tag);
    
    double pointCoords2[3] = {0,40,50}; 
    tag_t point2Tag = NULL_TAG;
    UF_CURVE_create_point(pointCoords2, &point2Tag);
    
    double pointCoords3[3] = {0,70,80}; 
    tag_t point3Tag = NULL_TAG;
    UF_CURVE_create_point(pointCoords3, &point3Tag);
    
    double pointCoords4[3] = {0,100,110}; 
    tag_t point4Tag = NULL_TAG;
    UF_CURVE_create_point(pointCoords4, &point4Tag);
    
    //创建点集
    tag_t points[4] = {point1Tag, point2Tag,point3Tag,point4Tag};
    tag_t feature_tag = NULL_TAG;
    UF_MODL_create_points_feature(4, points, &feature_tag);
    
    //获取点集里的点数量和所有点tag
    int num_points = 0;
    tag_t* ponts = NULL_TAG;
    UF_MODL_ask_points_parms(feature_tag, &num_points, &ponts);
    
    UF_UI_open_listing_window();
    for (int i = 0; i < num_points; i++)
    {
        //获得点的坐标
        double p1[3];
        UF_CURVE_ask_point_data(ponts[i], p1);
    
        //打印
        char msg[256];
        sprintf_s(msg, "X:%f, Y:%f, Z:%f", p1[0], p1[1], p1[2]);
        UF_UI_write_listing_window(msg);
        UF_UI_write_listing_window("
    ");
    }
    
    
    //释放
    UF_free(ponts);
    
    
    UF_terminate();
    
    Caesar卢尚宇
    2020年11月20日

  • 相关阅读:
    HDU 2655 主席树
    Codeforces Round #169 (Div. 2) A水 B C区间更新 D 思路
    Codeforces Round #402 (Div. 2) A B C sort D二分 (水)
    Docker 网络 Flannel
    Docker 搭建 etcd 集群及管理
    Iptables 端口转发
    CentOS7 citus9.5 集群安装及管理
    Ubuntu 忘记密码
    Zookeeper 启动错误
    数据结构 B树 B+树 B*树 LSM-树
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/14013244.html
Copyright © 2011-2022 走看看