[Is...] Posted March 5, 2019 Share Posted March 5, 2019 Hi, Is there a way to extract by PCM the list of Parameters (variables in Cache)? Currently I'm setting these variables (one by one) to the output protocol for audit Information; Could be easier using a loop with the list of Parameters and the function: getParameterNamed(). Link to comment Share on other sites More sharing options...
[Er...] Posted March 5, 2019 Share Posted March 5, 2019 Yes you can read the variables that a cached. Cant remember in my head how, but Ill look it up tomorrow if you can wait. Link to comment Share on other sites More sharing options...
[Is...] Posted March 5, 2019 Author Share Posted March 5, 2019 great , of course I can wait one day... Link to comment Share on other sites More sharing options...
[Er...] Posted March 6, 2019 Share Posted March 6, 2019 Uugh, I started to write a novel explaining dictionaries and keys etc, and the method I'm using, but I got bored. This will do what you asked for. Just remember that it will show the value of your loop index that's currently cached when the key comes up as index in the loop. (Key is what you would call variable) My recommendation is to remove the key "i", form your export to file if that's the index holder. Since it has no real purpose for your task. for i = 1 to baseSystem().machine.inspection.cache.temporaryParameters.dict.keys.size display(getParameterNamed(baseSystem().machine.inspection.cache.temporaryParameters.dict.associations,i)) next i Anyhow, my recommendation would be to use this, unless you need some specific formatting. Since you really don't need a loop. addToFile(xxx,baseSystem().machine.inspection.cache.temporaryParameters.dict.associations) I guess the loop method can potentially set you in a endless loop if you set variables within it. Eg. var[i] Link to comment Share on other sites More sharing options...
[Is...] Posted March 6, 2019 Author Share Posted March 6, 2019 😮 , it works perfectly !!!!! Thanks Link to comment Share on other sites More sharing options...
[Is...] Posted March 6, 2019 Author Share Posted March 6, 2019 🫣, I have other Question: is it possible to extract the Parameter List ? (which is not in the Cahe when the program starts) the Cache solution works great, but when I have too many variables is too much Information. Link to comment Share on other sites More sharing options...
[Er...] Posted March 6, 2019 Share Posted March 6, 2019 Im not sure I understand. That list is empty until variables a computed. Although pcm will be read in to cache when a measurement plan is opened. It belive occurs in step 6 of the loading. I know that since I once stored reference information in a variable, making the whole plan unable to load. Pleace describe what you like to accomplish. It's so much easier to help, if I know purpouse, to get the whole picture. Right now Im not sure what you ask for. Some times threads consists of one question, 15 wild guesses with different answers and suggetions wich all are wrong, intil the original poster clarifies and then the right answer usually turns up in 5 minutes... It's a nightmare for anyone searching in the future 🙂 Link to comment Share on other sites More sharing options...
[Is...] Posted March 7, 2019 Author Share Posted March 7, 2019 ... Link to comment Share on other sites More sharing options...
[Er...] Posted March 7, 2019 Share Posted March 7, 2019 Now I think I understand. How ever, isn't it very counterproductive to create a list, if you read them from a list in the first place? Since you already have them, why don't you just write it as a string on your protocol directly? Well is this what you are trying to achieve? This one you can get as a nicely formatted string, exactly like the list you already have. baseSystem().machine.inspection.definitions.parameters Link to comment Share on other sites More sharing options...
[Is...] Posted March 7, 2019 Author Share Posted March 7, 2019 👩🏫 , Yes, and as always works great !! Link to comment Share on other sites More sharing options...
[Ca...] Posted June 23, 2021 Share Posted June 23, 2021 Hello CMM group Sometimes in order to avoid say ever, I am out of context in PCM. I was trying to find the components (attributes, methods, etc.) of any Parameter, ex: baseSystem().machine.inspection.cache.temporaryParameters.dict.keys.size Impossible to find it in the Help or in all pdf files. As an OOP some references exists, but where to find them. The last answer to my problem of True Position characteristic was: THIS_ACT=formatL(getActual(THIS_CHAR).deviation, 6,4) while for the rest is ".actual,4,4)" independently that all are labeled "Actual". 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