NXOpen 创建方体block代码

C++

Session *theSession = Session::GetSession();//获得绘画窗口
Part *workPart(theSession->Parts()->Work());//工作部件
Part *displayPart(theSession->Parts()->Display());//显示部件
//创建方块
Features::Feature *nullFeatures_Feature(NULL);//定义nullFeatures_Feature并定义为空值
Features::BlockFeatureBuilder *bolockfeaturebuilder1;//定义bolockfeaturebuilder1
bolockfeaturebuilder1 = workPart->Features()->CreateBlockFeatureBuilder(nullFeatures_Feature);

bolockfeaturebuilder1->SetLength("60");//定义方体长
bolockfeaturebuilder1->SetWidth("100");//定义方体宽
bolockfeaturebuilder1->SetHeight("50");//定义方体高
Point3d orgin1(0.0,100.0,0.0);//定义方体创建点
bolockfeaturebuilder1->SetOrigin(orgin1);//设置方体创建点
Features::Feature *Feature1;//定义Feature1
Feature1 = bolockfeaturebuilder1->CommitFeature();//确认创建
bolockfeaturebuilder1->Destroy();//释放bolockfeaturebuilder1

 

怡宁塑胶模具设计
原文地址:https://www.cnblogs.com/hqsalanhuang/p/14176566.html