On 03/16/2013 04:07 PM, Marco Patzer wrote:
Hi,
I am looking for a way to assign the value of a TeX macro to an MP variable. However, this only works the first time, then the value is not updated any longer. Example:
I'm not quite sure if this is what you're looking for, but here is an example how you could do this with \MPvars: \def\Circlediameter{15mm} \def\setupCircle#1[#2]% {\getparameters[Circle][diameter=15mm,#2]} \setupMPvariables [mycircle] [diameter=\Circlediameter, ] \startuseMPgraphic{mycircle} fill unitcircle scaled \MPvar{diameter} withcolor red ; \stopuseMPgraphic \starttext \useMPgraphic{mycircle} \blank[1cm] \setupCircle[diameter=5cm] \useMPgraphic{mycircle} \blank[1cm] \setupCircle[diameter=0.5cm] \useMPgraphic{mycircle} \stoptext Thomas