Jump to content

Turn on/off Excel output using PCM


---
 Share

Recommended Posts

My boss has asked if I can develop a PCM code to allow a prompt to ask if you'd like to output to excel or not. I'm guessing he's forgot to tick/un-tick a box at the start of the program.
I've got a general idea of how to do perform the inputs etc, but I don't know how to activate/deactivate something that has a tick box at the start of a program run.
How can I achieve this using PCM?

Start Measurement Screenshot.jpg

Link to comment
Share on other sites

Is excel turned on...

settingGet("resultToExcelFile")
On / Off

settingPut("resultToExcelFile",true)
settingPut("resultToExcelFile",false)
Change excel file path

settingPut("excelReportName",filePath)
Link to comment
Share on other sites


listOfNames = baseSystem().machine.inspection.settings.localBindingNames.asList.sort
for i = 1 to listOfNames.size
	display(getParameterNamed(listOfNames,i))
next i
Link to comment
Share on other sites

Just a friendly explenation 😃

localBindingNames does not really do what you might think it does. It recives the key from eg. a dictionary.
So esentially the same as baseSystem().machine.inspection.settings.keys
Eg: (in old format)
dict(#names -> "superman") localBindingNames, gets the key "names".
One might, or might not think that it retrives methods linked to each others.

How ever, I think these are the specific settings of start dialog you are asking for? As Phillips method retrievs a lot of settings/dicts not related to the start dialog. And leaves some of them out. (Maybe you can dig thru the dicts and find them, I havn't checked 🙂 )

Start settings
#baseSystemRealName
#baseSystemType
#clearOldRes
#compactProtocol
#displayPlots
#featureListName
#meMode
#naviMode
#pdfExport
#ptxExport
#presProtocol
#printer
#printPlots
#protNumbers
#protocolHead
#psExport
#runMode
#selection
#speed
#protocolDefinition
#activeTechnology

Result settings
#resultToTableFile
#resultToDmisFile
#resultToQdasFile
#resultToQifFile
#resultToDmlFile
#resultToExcelFile
#resultsToPDFFile
#resultToMdmFile
#resultsToPTXFile
#resultToPiWebFile

And to be an asshole 🤣
display(baseSystem().machine.inspection.settings.localBindingNames.asList.sort)
Link to comment
Share on other sites

 Share

×
×
  • Create New...