Jump to content

Better method?


---
 Share

Recommended Posts

Rather new to PCM but learning more every day. Is this satisfactory or is there a better way of doing this?
I would normally use separate .para files. Seems to make more sense to have everything in one location.
************************************************************************************************************************

LN = getRecordHead("order")

clearCAD()
dir = getActualInspectionDir()

Run=inquireList("Which operation do you wish to run?","Operation-10","Operation-20")
setRunID(Run)

if Run=="Operation-10","Operation-20" then setRunID(Run)

endif

selectCase Run
case "Operation-10"
loadCADFile(dir+"\123456 - Turn-Blank.sab")

// Customer Drill 5.0 MM
// 123456 Op-10
Datum_A = 7.550
Diameter_15 = 4.975
Diameter_20 = 7.520
Datum_B = 5.000

case "Operation-20"
loadCADFile(dir+"\123456 - Grind-OD.sab")

// Customer Drill 5.0 MM
// 123456 Op-20
Datum_A = 7.475
Diameter_15 = 4.975
Diameter_20 = 7.520
Datum_B = 5.000

endSelect
Link to comment
Share on other sites

This looks solid to me.
The "if Run=="Operation-10","Operation-20" then setRunID(Run)
endif"
May be redundant as it should be setting the run id in the command above, so I'd say test with and without it to be sure, but can probably remove it.

I would also consider setting a caseElse that throws a message to say "hey, somehow you chose something that I wasn't expecting, try again" and then cncbreaks to prevent the cmm trying to run something unexpected.
Link to comment
Share on other sites

 Share

×
×
  • Create New...