【NX二次开发源码分享】通过弦长,角度 公差创建曲线上点
可能大家用的到,选择一条曲线,通过输入的公差,自动创建一些列的点集!
void testSimulation::do_it()
{
//TaggedObject* toolbody = select_by_mask();
TaggedObject* pathCurve = select_by_type();
//std::vector< NXOpen::TaggedObject * > any_objs = select_any_objects();
// get the path point
double ctol = 0.0;
double atol = 0.0;
double stol = 10.0;
double *pts;
int num =0;
char msg;
int error =0;
double (*points);
tag_t pointTag;
UF_initialize();
UF_MODL_ask_curve_points(pathCurve->Tag(),ctol,atol,stol,&num,&pts);
sprintf(msg,"the number of points:%d",num);
print(msg);
points = (double(*))(UF_allocate_memory(num*sizeof(double),&error));
for(int i =0 ; i < 3*num;++i)
{
sprintf(msg,"The points are: %f\n",pts);
print(msg);
}
for (int j = 0; j < num; j++)
{
points = pts;
points = pts;
points = pts;
UF_CURVE_create_point(points,&pointTag);
}
UF_free(points);
UF_free(pts);
UF_terminate();
// TODO: add your code here
}
页:
[1]