[Me...] Posted June 17, 2020 Share Posted June 17, 2020 Hello all, I have programmed a curve with formula. In the prefabrication the curve has an oversize and segmented tolerances of the prefabrication. Later I want to measure this curve in the final inspection using the same test plan. The calculation of the curve is parameterized - prefabrication and final inspection. Everything I can parameterize, not the segmented curve tolerances. Does anyone have a solution? Link to comment Share on other sites More sharing options...
[Is...] Posted June 17, 2020 Share Posted June 17, 2020 This works good for me: Tol1_UT = 0.01 Tol1_LT = -0.01 Tol2_UT = 0.03 Tol2_LT= -0.015 START = -25 // start evaluation angle Tol 1 END = 30 // end evaluation angle Tol 1 Tol2S = -10 // range Tol 2 Tol2E = 10 //rangeTol 2 Radius= 30 // Radius step= 0.10 // points step Nomvalues="xNom yNom zNom uNom vNom wNom lTol uTol maskEval maskBF" +cr() numberofpoints= int(( END - START ) /step ) for i=1 to numberofpoints if (START >= Tol2S) and (START <= Tol2E) then UT=Tol2_UT LT =Tol2_LT else UT=Tol1_UT LT =Tol1_LT endif X= cos(START) * Radius Z=sin(START) * Radius Nomvalues= Nomvalues + formatR(X ,0,10)+ chr(9) + "0" + chr(9) + formatR(Z ,0,10)+ chr(9) + formatR(cos(START) ,0,10) + chr(9) + "0" + chr(9) + formatR(sin(START) ,0,10) + chr(9) + formatR(LT,0,10) + chr(9) + formatR(UT,0,10) + chr(9) + "0" + chr(9) + "0" +cr() START=START + step next i deleteFile(getActualInspectionDir() + "\Nominal.txt") addToFile(getActualInspectionDir() + "\Nominal.txt",Nomvalues) Link to comment Share on other sites More sharing options...
[Ro...] Posted June 17, 2020 Share Posted June 17, 2020 So you just want to change the tolerance of a profile? put this in your presettings itemSelected = inquireList("Is this part","Prefab","In Process") if itemSelected=="Prefab" then Tol1=0.005 Tol2=0.010 endif if itemSelected=="In Process" then Tol1=0.005 Tol2=0.005 endif Then in the tolerance box right click on the box and hit formula and put the word 'Tol1' & 'Tol2' in as your formula. Link to comment Share on other sites More sharing options...
[Me...] Posted June 26, 2020 Author Share Posted June 26, 2020 Please sign in to view this quote. Thank you for your idea. I have tested, it works very good. //Winfried Link to comment Share on other sites More sharing options...
[Cl...] Posted June 26, 2020 Share Posted June 26, 2020 Please sign in to view this quote. Link to comment Share on other sites More sharing options...
[Ro...] Posted June 26, 2020 Share Posted June 26, 2020 Please sign in to view this quote. Put it in the program presettings so the inquire box will pop up at the start of the program. Link to comment Share on other sites More sharing options...
[Cl...] Posted June 26, 2020 Share Posted June 26, 2020 Could I use the same basic formula (with some slight modifications) to send report results to two separate folders, depending on the choice. Link to comment Share on other sites More sharing options...
[Ro...] Posted June 26, 2020 Share Posted June 26, 2020 Please sign in to view this quote. In general you can use the if statement to set a variable, if that variable is used in a filepath then yes it would change the save location. I recently did that exact thing for our SPC reports, we mold then machine parts in 2 different op's and use 1 program to check them. but we only want spc data to be sent in the machining op so depending on what is selected the file will be dropped in its designated folder. the molding folder never gets emptied and the milling folder gets eaten by WinSPC. Link to comment Share on other sites More sharing options...
[Ro...] Posted June 26, 2020 Share Posted June 26, 2020 Actually i lied, i remember now since i was appending a program that was already in use and not writing it from scratch i had some difficulties, i wanted the machined op report to be left in the same location, but the Molded part was to be saved 1 layer deeper in the file tree. So what i did was to tack an if statement in the post script so of the selection was machining then the file path would be the original filepath, but if the selection was Molding then the reports would be dumped into the +("Molding\") folder. if OpSelected=="Molding" then dirPath = filePath2 +("Molding\") + PARTNO + (" ") + LOT + (" ") + ext //write recore here endif if OpSelected=="Machining" then dirPath = filePath2 + PARTNO + (" ") + LOT + (" ") + ext //write recore here endif Link to comment Share on other sites More sharing options...
[Cl...] Posted June 26, 2020 Share Posted June 26, 2020 I have this working in one program, but won't work in this one? Presettings ************************************************************************************************************************* clearCAD() dir = getActualInspectionDir() Part_Size = inquireList("Which part number would you like to run?", "101221","101228") selectCase Part_Size case "101221" readPCMFile(dir + "\101221.PARA") loadCADFile(dir+"\101221.sab") case "101228" readPCMFile(dir + "\101228.PARA") loadCADFile(dir+"\101228.sab") endSelect Part_Type = inquireList("Are you running a Set-up Part or full Production?","Set-up","Production") selectCase Part_Type case "Set-up" setRecordHead("partid","Set-up") case "Production" setRecordHead("partid","Production") endSelect ************************************************************************************************************************* Postsettings "T:\DMR\CMM Data\10122X Op-10_Rev_A\"+ getRecordHead("planid")+ getRecordHead("partnbinc")+".txt" if fileExists(filePath) then // if it can't find the file then it will not error out. if response == "Set-up" copyFile(filePath,"T:\DMR\CMM Data\Set-up\theresults.txt") else copyFile(filePath,"T:\DMR\CMM Data\Production\theresults.txt") endif //inquireList else message("could not find file : " + filePath) endif //fileExists Link to comment Share on other sites More sharing options...
[Cl...] Posted June 26, 2020 Share Posted June 26, 2020 Never mind, I figured it out. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in