|
通过创建各截面的样条曲线,再通过Through Curves方法创建曲面
分别录制了C#和C++两种代码
用C#能够实现,但是同样原理,用C++就无法实现
C++中执行到CreateRuleCurveFeatureTangent这个函数就会报错,无法执行
C++代码如下:
std::vector<NXOpen::Features::Feature *> features1(1);
NXOpen::Features::StudioSpline *studioSpline1(dynamic_cast<NXOpen::Features::StudioSpline *>(workPart->Features()->FindObject("SPLINE(2)")));
features1[0] = studioSpline1;
NXOpen::Spline *spline1(dynamic_cast<NXOpen::Spline *>(studioSpline1->FindObject("CURVE 1")));
NXOpen::Curve *nullNXOpen_Curve(NULL);
NXOpen::CurveFeatureTangentRule *curveFeatureTangentRule1;
curveFeatureTangentRule1 = workPart->ScRuleFactory()->CreateRuleCurveFeatureTangent(features1, spline1, nullNXOpen_Curve, false, 0.0095, 0.5);
换成C#就能够执行成功
都是通过录制代码获得的,请大神帮忙看看到底是哪里出错了
|
|