【NX二次开发】创建点特征

创建点特征

#include <NXOpen/NXException.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/BasePart.hxx>
#include <NXOpen/Builder.hxx>
#include <NXOpen/Expression.hxx>
#include <NXOpen/ExpressionCollection.hxx>
#include <NXOpen/Features_BaseFeatureCollection.hxx>
#include <NXOpen/Features_PointFeatureBuilder.hxx>
#include <NXOpen/NXObject.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/Point.hxx>
#include <NXOpen/PointCollection.hxx>
#include <NXOpen/Scalar.hxx>
#include <NXOpen/ScalarCollection.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/SmartObject.hxx>
#include <NXOpen/Unit.hxx>
#include <NXOpen/UnitCollection.hxx>

 

int createPoint(double douP[3])
{
    NXOpen::Session *theSession = NXOpen::Session::GetSession();
    NXOpen::Part *workPart(theSession->Parts()->Work());
    NXOpen::Point3d point01;
    point01.X = douP[0];
    point01.Y = douP[1];
    point01.Z = douP[2];
    NXOpen::Point *point5;
    point5 = workPart->Points()->CreatePoint(point01);
    NXOpen::Features::PointFeatureBuilder *pointFeatureBuilder1;
    NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);
    pointFeatureBuilder1 = workPart->BaseFeatures()->
        CreatePointFeatureBuilder(nullNXOpen_Features_Feature);
    pointFeatureBuilder1->SetPoint(point5);
    NXOpen::NXObject *nXObject1;
    nXObject1 = pointFeatureBuilder1->Commit();
    pointFeatureBuilder1->Destroy();
    return 0;
}

 

posted @ 2022-06-23 22:09  王牌飞行员_里海  阅读(189)  评论(0编辑  收藏  举报