zoukankan      html  css  js  c++  java
  • NX二次开发遍历工作部件所有体的显示属性(图层, 颜色, 隐藏状态, 线宽, 字体, 高亮状态)

    VS2019 NX1946

    #include <NXOpen/Part.hxx>
    #include <NXOpen/PartCollection.hxx>

    #include <NXOpen/ListingWindow.hxx>

    #include <uf_layer.h>
    #include<uf_obj.h>

    UF_initialize();

    Part* workPart;//定义工作部件
    workPart = theSession->Parts()->Work();//获取工作部件

    char msg[256];

    std::vector<int> BodyTagVector;//对象TAG容器
    BodyTagVector.clear();

    //遍历工作部件所有体的显示属性
    BodyCollection* bodys = workPart->Bodies();
    for (BodyCollection::iterator ite = bodys->begin(); ite != bodys->end(); ite++)
    {
    Body* bodys = (*ite);
    BodyTagVector.push_back(bodys->Tag());

    //获得对象信息
    UF_OBJ_disp_props_s dispprops;
    UF_OBJ_ask_display_properties(bodys->Tag(), &dispprops); //获取对象的显示属性(图层, 颜色, 隐藏状态, 线宽, 字体, 高亮状态)
    sprintf(msg, "体的TAG: %d", bodys->Tag());
    theSession->ListingWindow()->WriteLine(msg);
    sprintf(msg, "体的图层:%d", dispprops.layer);
    theSession->ListingWindow()->WriteLine(msg);
    sprintf(msg, "体的颜色:%d", dispprops.color);
    theSession->ListingWindow()->WriteLine(msg);
    sprintf(msg, "体的隐藏状态:%d", dispprops.blank_status);
    theSession->ListingWindow()->WriteLine(msg);
    }

    UF_terminate();

    怡宁塑胶模具设计
  • 相关阅读:
    运算符优先级问题
    文件操作工具,需者自取
    Text文档编码识别方法
    删除重复文件的程序
    修道士和野人问题
    猜数字游戏
    存储器层级图
    IL指令汇总
    输入1~8,每个数字不重复
    厦门大学线下编程比赛第一题:求和
  • 原文地址:https://www.cnblogs.com/hqsalanhuang/p/14957772.html
Copyright © 2011-2022 走看看