Thanks for that information, but I guess I'm not being clear. I have a parametric file for a timing belt pulley:
http://www.thingiverse.com/thing:23992It allows a space for a nut to be inserted to hold the pulley onto a threaded rod when the pulley is big enough to support it. The users of this file can specify the diameter of the rod (the shaft) as one of the parameters. The script is expected to then include space for a nut which would fit that shaft. Currently, it is hard coded to an M8 nut. I'd like to update the script so that it will automatically select a standard nut size which is appropriate for the shaft size. E.g. if the shaft diameter is between x and y, then use a z size nut.
I'm not seeing a way to do this in openscad.
Moreover, it just blows me away that 1) you apparently just can't make an assignment inside an "if" block. 2) that fact isn't documented or explained anywhere that I can find.
so the conditional reassignment of a variables value is not supported.
Which still leaves me wondering how I'm going to support multiple nut sizes... I guess I have to change my code to call a routine which then has the if's which then call another routine with hard coded numbers for the nut sizes.