//======================================================================================= // Production Mill QuikStep Thread Mill Control Panel // tm_main.mcl - validates the users panel selection and creates toolpath to thread mill // // called by the GO button from the Thread Mill Control Panel //======================================================================================= // 2Aug07 RMG : v14.5 cleanup INTEGER:#last_el INTEGER:#cur_seq STRING:#tm_path=GET_MCL_PATH() //set a flag for undo status since we can't control dimming behaviour #tm_undo=0 //======================================================================================= //call the validation macro to test panel inputs MAC_EXE[FN=#tm_path+"tm_vald.mcl"] //======================================================================================= //if the return code is set to 1 just exit early IF(#bad_panl=1) GOTO(done) ENDIF //set a flag for test for active group #grp_test=0 //check for the presence of an active group and save it #grp_test=GRP(0) // new,was (0) 9-8-94 dz IF(#grp_test>0) NAME_GRP[GN="TM_SAVE"] #grp_test=1 ENDIF //store current sequence location and state of before/after switch #cur_seq=SEQEL() #ba_set=SEQBA() //get last element in the database - we're gonna stuff the new geometry there and //then move them back to current seq - it's much easier this way - trust me #last_el=TOTEL() ELMT_SEQ[BA=1, EL=#last_el, ME=0] //======================================================================================= //call the macro to calculate the additional values we need to create the passes //it's split up into internal and external versions of the file IF(#tm_type=0) MAC_EXE[FN=#tm_path+"tm_calci.mcl"] ELSE MAC_EXE[FN=#tm_path+"tm_calcx.mcl"] ENDIF //create the actual passes - based on recommendation provided in the VARDEX catalogue //default to motion providing right hand thread and climb cuts for both int. and ext. //======================================================================================= //call the proper macro based on the type of thread and the selected approach method //internal with tangent entry IF(#tm_type=0, AND#tm_leadio=0) MAC_EXE[FN=#tm_path+"tm_makit.mcl"] ENDIF //internal with radial entry IF(#tm_type=0, AND#tm_leadio=1) MAC_EXE[FN=#tm_path+"tm_makir.mcl"] ENDIF //external with tangent entry IF(#tm_type=1, AND#tm_leadio=0) MAC_EXE[FN=#tm_path+"tm_maket.mcl"] ENDIF //external with radial entry IF(#tm_type=1, AND#tm_leadio=1) MAC_EXE[FN=#tm_path+"tm_maker.mcl"] ENDIF //finally rotate the thing around if the user has elected to do so IF(#tm_angle<>0) NEW_GRP[] GET_GRP[GN="TM_THRD"] ROTATE[XS=#tm_xaxis, YS=#tm_yaxis, AN=#tm_angle, CP=0] ENDIF //now group it, name it, and put it back where the insert sequence was NEW_GRP[] GET_GRP[GN="TM_THRD"] ELMT_SEQ[BA=#ba_set, EL=#cur_seq, ME=0] SEQ_MOVE[SC=0] NEW_GRP[] //put back the old group if the user had one IF(#grp_test=1) GET_GRP[GN="TM_SAVE"] ENDIF //clean up the screen a bit REDRAW[] @done //clear all the variable so repeated use of the panel will work VAR_REMOVE[VN="elnum"] #ba_seq=1000000 #cur_seq=1000000 #last_el=1000000 #tl_clrad=1000000 #li_rlil=1000000 #li_tlil=1000000 #li_sidel=1000000 #li_zmove=1000000