【UG二次开发】UF_MODL_ask_curve_points 曲线离散成点
曲线离散成点:
//离散曲线 UF_MODL_ask_curve_points extern DllExport void ufsta(char *param, int *returnCode, int rlen) { UF_initialize(); tag_t tagEdge = 45262; double ctol(0.0); double atol(0.0); double stol(10.0);//步进公差10 int numpts(0); tag_t pt_tag(NULL_TAG); double *ufPts = NULL; UF_MODL_ask_curve_points(tagEdge, ctol, atol, stol, &numpts, &ufPts); double adTempPoint[3] = {0.0,0.0,0.0}; tag_t tPointEnd = NULL_TAG; for (int i = 0; i < (numpts-1); i++) { adTempPoint[0] = ufPts[0 + i * 3]; adTempPoint[1] = ufPts[1 + i * 3]; adTempPoint[2] = ufPts[2 + i * 3]; UF_CURVE_create_point(adTempPoint, &tPointEnd); } UF_free(ufPts); UF_terminate(); } extern int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); }