UG爱好者

标题: 如何访问Builder生成的特征 [打印本页]

作者: Crazy_for    时间: 2018-4-25 16:14
标题: 如何访问Builder生成的特征
大家好!我使用DatumPlaneBuilder创建了一个基准面,想要获得指向这个基准面的指针,该怎么操作?
  1. NXOpen::DatumPlane* CreateDatumPlane(Part* workPart, Point3d origin, Vector3d direction)
  2. {
  3. NXOpen::Features::Feature* nullDatumPlane(NULL);
  4. NXOpen::Features::DatumPlaneBuilder* datumPlanebuilder;
  5. datumPlanebuilder = workPart->Features()->CreateDatumPlaneBuilder(nullDatumPlane);

  6. NXOpen::Direction* dir;
  7. NXOpen::Point* originPoint = workPart->Points()->CreatePoint(origin);

  8. dir = workPart->Directions()->CreateDirection(originPoint, vector0->Vector());
  9. datumPlanebuilder->SetPointAndDirection(originPoint, dir);

  10. NXOpen::Features::Feature* features;
  11. features = datumPlanebuilder->CommitFeature();


  12. DatumPlane* da = dynamic_cast<DatumPlane*>();
  13. char msg[128];
  14. sprintf(msg, "%p", da);
  15. uc1601(msg, 1);
  16. //datumPlanebuilder->Destroy();
  17. return da;
  18. }
复制代码



作者: Crazy_for    时间: 2018-4-26 10:44
已解决,感谢




欢迎光临 UG爱好者 (https://www.ugsnx.com/) Powered by Discuz! X3.2