OPTIONINDEX Example in Dynamic Pricing has "Delay" Problem


The example using OPTIONINDEX in the Knowledge Center article http://help.sketchup.com/en/article/114564 (Implement dynamic pricing) doesn’t work properly for me (SU 2015, Windows 7 64 bit, IE 11 update version 11.0.17); OPTIONINDEX appears to return the value for the previous entry instead of the current one. As an example, I added the attribute “Index” to the example optionindex_function.skp; see attached file optionindex_function_delay.skp.optionindex_function_delay.skp (539.4 KB) .

Is this a known problem, & is there a workaround (other than using multiple “ifs”)? Same seems to hold for OPTIONLABEL.

If this is a known problem, I recommend you update the examples, so others don’t spend the time required to investigate this (learning experience notwithstanding).

Thanks & sorry if I missed any previous answers.


OPTIONINDEX Iteration Bug in Dynamic Pricing Example
OPTIONLABEL fails for LenZ

I don’t know if its bad form to reply to myself before anyone else does, but…

I found a similar problem in another post, where it was a secondary issue (OPTIONLABEL(“material”) shows “delay”) to primary issue of OPTIONLABEL(“LenZ”) not working: OPTIONLABEL fails for LenZ .

However, the fix there (as I understand it, using an intermediate variable) appears to solve my problem also: optionindex_function_delay_workaround.skp (540.8 KB) .

I assume this has something to do with “order of calculation”, & would still like a more elegant fix if anyone finds one.



the article is incorrect, first it shows cherry as the first in the list

then later it claims cork is first and cherry is second