hi friends!
i am trying to replace & add the strings using
"UF_MODL_replace_feat_strings" function
but somehow the function is not working...
can anyone suggest any solution?
my code:
Code:void defGeometry::ReplaceSpline(std::vector<struct geometricSection>sections) { int j=1; tag_t PartTag=NULL_TAG; tag_t feat_tag=NULL_TAG; char feat_name[]="THROUGH"; UF_STRING_p_t sectionEditData; sectionEditData=new UF_STRING_t ; tag_t feature_id; //sectionEditData= (UF_STRING_t *) malloc (sizeof(UF_STRING_t)*ActionSide.NumberOfSections); PartTag=UF_PART_ask_display_part(); UF_CALL(UF_OBJ_cycle_by_name_and_type (PartTag, feat_name, UF_feature_type, FALSE, &feat_tag)); if(!feat_tag) { sysLogPrint("Failed to find feature tag!"); } else { sysLogPrint("Feature Tag=%d\n\n",feat_tag); } UF_CALL(UF_MODL_ask_current_feature (PartTag, &feature_id )); UF_CALL(UF_MODL_set_current_feature (feat_tag )); for(int i=0;i<ActionSide.NumberOfSections;i++ ) { int k; UF_MODL_init_string_list(§ionEditData[i]); UF_MODL_create_string_list(1, 4, §ionEditData[i]); sectionEditData[i].string[0]=4; sectionEditData[i].dir[0]=UF_MODL_CURVE_START_FROM_BEGIN; for(k=1;k<5;k++) { sectionEditData[i].id[k]=sections[i].section_tags[k]; } if(j<=3) { if(!UF_CALL(UF_MODL_replace_feat_strings (feat_tag,UF_MODL_STRING_REPLACE,§ionEditData[i],1,j++))) { sysLogPrint("spline removed j<=3\n"); } else { sysLogPrint("spline not removed \n"); } } else { if(!UF_CALL(UF_MODL_replace_feat_strings (feat_tag, UF_MODL_STRING_ADD, §ionEditData[i], 1, (j++)-1))) { sysLogPrint("spline add \n"); } else { sysLogPrint("spline not add\n"); } } } if(!UF_CALL(UF_MODL_set_update_fail_option(UF_MODL_UPDATE_ACCEPT))) { sysLogPrint("modl update sucess with accept option\n"); } else { sysLogPrint("modl update failed with accept option\n"); } if(!UF_CALL(UF_MODL_update ())) { sysLogPrint("update sucess\n"); } else { sysLogPrint("update failed\n"); } UF_MODL_free_string_list (sectionEditData); };



LinkBack URL
About LinkBacks



