Home » Helpful Articles » NX OPEN C++ secondary development: create cuboid

NX OPEN C++ secondary development: create cuboid

Posted by: Fymicohuang 2021-09-27 Comments Off on NX OPEN C++ secondary development: create cuboid

This is how to create a rectangular parallelepiped in NXOPEN, and the “//” is followed by an explanation
NXOpen::Features::BlockFeatureBuilder *FeatureBuilder1;//declared body name

NXOpen::Features::Feature *nullNXOpen_Features_Feature(NULL);//Initialize empty variables

FeatureBuilder1= workPart->Features()->CreateBlockFeatureBuilder(nullNXOpen_Features_Feature);//First create an empty

FeatureBuilder1->BooleanOption()->SetType(NXOpen::GeometricUtilities::BooleanOperation::BooleanTypeCreate);//Set the Boolean method to the creation body: BooleanTypeCreate

//Boolean operations are divided into the following types

//BooleanTypeCreate Create. //Create

//BooleanTypeUnite Unite.//Sum
//BooleanTypeSubtract Subtract.// Difference
//BooleanTypeIntersect Intersect. //Intersect

FeatureBuilder1->SetOriginAndLengths(top_plate_origin1, platewidth, platelength, topplatethick);//Set the origin, length, width, and height of the cuboid

//Where top_plate_origin1 is the origin variable, NXOpen::Point3d

//platelength: const char * string

//platewidth: const char * string

//topplatethick: const char * string

NXOpen::Features::Feature *Feature1 = FeatureBuilder1->CommitFeature();//Make features

FeatureBuilder1->Destroy();//Clear memory

//This is the method of creating a cuboid in NXOPEN, and the explanation behind “//”

//Need to use the class:

More methods will be shared later, I hope it will be useful to everyone.