• 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();

    怡宁塑胶模具设计
  • 相关阅读:
    ThreadPoolExecutor
    HashMap
    ReentrantReadWriteLock
    AbstractQueuedSynchronizer
    KAFKA:如何做到1秒发布百万级条消息
    Kafka生产者性能优化之吞吐量VS延迟
    Hadoop YARN:调度性能优化实践(转)
    Windows下安装MySQL压缩zip包
    Android 8 蓝牙打开过程
    msm audio platform 驱动代码跟踪
  • 原文地址:https://www.cnblogs.com/hqsalanhuang/p/14181522.html
Copyright © 2020-2023  润新知