当前位置: 首页 > news >正文

NX二次开发,创建基准平面

通过点与方向创建基准平面

//通过点与方向创建基准平面
NXObject* CreateDatumOlane(Point3d iPoint, Vector3d iVec, NXObject* iDatumPlane)
{Session* theSession = Session::GetSession();Part* workPart = theSession->Parts()->Work();Features::DatumPlaneFeature* datumPlaneFeature1 = NULL;if(iDatumPlane != NULL)datumPlaneFeature1 = dynamic_cast<Features::DatumPlaneFeature*>(iDatumPlane );Features::DatumPlaneBuilder* datumPlaneBuilder1 = workPart->Features()->CreateDatumPlaneBuilder(datumPlaneFeature1 );Point* point1 = workPart->Points()->CreatePoint(iPoint);Direction* direction1 = workPart->Directions()->CreateDirection(iPoint, iVec, SmartObject::UpdateOption::UpdateOptionWithinModeling);datumPlaneBuilder1->SetPointAndDirection(point1, direction1);NXObject* vObject = datumPlaneBuilder1->CommitFeature();datumPlaneBuilder1->Destroy();return vObject;
}//通过面与偏置距离创建基准平面
NXObject* CreateDatumOlane(Face* iFace, double iDis, NXObject* iDatumPlane)
{Session* theSession = Session::GetSession();Part* workPart = theSession->Parts()->Work();Features::DatumPlaneFeature* datumPlaneFeature1 = NULL;if(iDatumPlane != NULL)datumPlaneFeature1 = dynamic_cast<Features::DatumPlaneFeature*>(iDatumPlane );Features::DatumPlaneBuilder* datumPlaneBuilder1 = workPart->Features()->CreateDatumPlaneBuilder(datumPlaneFeature1 );Plane* plane1 = datumPlaneBuilder1->GetPlane();plane1->SetUpdateOption(SmartObject::UpdateOptionWithinModeling);plane1->SetMethod(PlaneTypes::MethodTypeDistance);//创建平面模式//目标面vector<NXObject*> geom1(1);geom1[0] = iFace;plane1->SetGeometry(geom1);plane1->SetFlip(true);//方向反转plane1->SetReverseSide(true);//平面反向plane1->SetAlternate(PlaneTypes::AlternateTypeOne);plane1->SetExpression("25");plane1->Evaluate();NXObject* vObject = datumPlaneBuilder1->CommitFeature();datumPlaneBuilder1->Destroy();return vObject;
}

http://www.mrgr.cn/news/93965.html

相关文章:

  • 正则表达式(2)匹配规则
  • ①Modbus TCP转Modbus RTU/ASCII网关同步采集无需编程高速轻松组网
  • AI学习记录 - PPO算法草稿
  • LiveCommunicationKit OC 实现
  • 力扣热题 100:二叉树专题进阶题解析(后7道)
  • 23种设计模式简介
  • Liunx(CentOS-6-x86_64)使用Nginx部署Vue项目
  • VUE3开发-9、axios前后端跨域问题解决方案
  • 英语学习(GitHub学到的分享)
  • 滑动窗口算法-day7(越长越合法子数组)
  • 18、函数的反柯里化
  • SpringMVC 基本概念与代码示例
  • 【git】 贮藏 stash
  • 《 C++ 点滴漫谈: 三十 》高手写 C++,参数这样传才高效!你真的用对了吗?
  • 【git】删除已加入 .gitignore却仍被git追踪的文件
  • 1分钟看懂React的那些Hook‘s
  • java每日精进 3.11 【多租户】
  • 【性能测试】Jmeter详细操作-小白使用手册(2)
  • win10安装部署DB-gpt,坑多
  • 【Linux docker】关于docker启动出错的解决方法。