zoukankan      html  css  js  c++  java
  • NXOpen 两点建方体

    C++

    //用户头文件
    #include <NXOpen/Body.hxx>
    #include <NXOpen/Builder.hxx>
    #include <NXOpen/Expression.hxx>
    #include <NXOpen/ExpressionCollection.hxx>
    #include <NXOpen/Features_BlockFeatureBuilder.hxx>
    #include <NXOpen/Features_Feature.hxx>
    #include <NXOpen/Features_FeatureBuilder.hxx>
    #include <NXOpen/Features_FeatureCollection.hxx>
    #include <NXOpen/GeometricUtilities_BooleanOperation.hxx>
    #include <NXOpen/Part.hxx>
    #include <NXOpen/PartCollection.hxx>
    #include <NXOpen/Point.hxx>
    #include <NXOpen/PointCollection.hxx>
    #include <NXOpen/Unit.hxx>
    #include <NXOpen/UnitCollection.hxx>
    #include <NXOpen/Update.hxx>

    //用户代码
    Part *workPart = theSession->Parts()->Work();
    Part *displayPart = theSession->Parts()->Display();

    Features::Feature *nullFeatures_Feature(NULL);
    Features::BlockFeatureBuilder *blockFeatureBuilder1;
    blockFeatureBuilder1 = workPart->Features()->CreateBlockFeatureBuilder(nullFeatures_Feature);

    blockFeatureBuilder1->BooleanOption()->SetType(GeometricUtilities::BooleanOperation::BooleanTypeCreate);
    blockFeatureBuilder1->SetType(Features::BlockFeatureBuilder::TypesTwoPointsAndHeight); //设置两点建方体类型

    //获取UI选取的点
    Point3d point1 = point01->Point();
    Point3d point2 = point02->Point();

    //获取UI输入的高度转char*字符
    double Height = double0->Value();
    char H[256];
    sprintf(H,"%f",Height);

    blockFeatureBuilder1->SetTwoPointsAndHeight(point1, point2, H );

    Features::Feature *feature1;
    feature1 = blockFeatureBuilder1->CommitFeature();
    blockFeatureBuilder1->Destroy();

    怡宁塑胶模具设计
  • 相关阅读:
    C语言运算符优先级和口诀
    跨域问题的解决方案 php
    浅谈跨域攻击及预防
    浅析Websocket--PHP
    linux下的删除目录和文件的方法
    python魔法方法
    双指针
    python常用模块
    python三大器
    对闭包的误区
  • 原文地址:https://www.cnblogs.com/hqsalanhuang/p/14181522.html
Copyright © 2011-2022 走看看