<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I figured it out with the following command:<div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); ">"scantokens ATTR_color;\n"<span style="color: #000000"> +</span></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 11px;"><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">Scantokens evaluates the string it is applied to, so I just had to change ATTR_color to "color col; col:=red" for example.</span></span></font></div><div><br></div><div>Carl</div><div><br></div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><div>On Sep 11, 2009, at 3:35 PM, Carl Magnuson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I am attempting to color the walls of different systems with different colors using the -attr flag and a user defined wall:<div><br></div><div>portion of code in scrap:</div><div><div>line u:wall -attr color "(0.1, 0.2, 0.8);"</div><div>1392.9359853260457 -71.62435442682576</div><div>1395.5759853260456 125.20564557317425</div><div>endline</div><div><br></div><div>portion of code in layout:</div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; ">def l_u_wall (expr P)=<span style="color: #000000"> </span></span></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-style-span" style="color: rgb(42, 0, 255); "><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#000000"> </font></span>T:=identity;</span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span class="Apple-tab-span" style="white-space:pre"> </span>if known(ATTR__color):</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" color="#000000"> <span class="Apple-tab-span" style="white-space:pre"> </span></font></span>pickup PenA;<span style="color: #000000"> </span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span></span>draw P withpen PenA withcolor ATTR__color\n</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"> </span></span>fi;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); ">enddef;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><font class="Apple-style-span" color="#000000"><br></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); ">initsymbol(\"l_u_wall\");</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;">I am not having any success however. Is it possible to set and read attributes from lines as I am trying to do? Is somebody aware of an alternate way to pass in a color argument to the metapost definition (instead of defining separate walls for each different colored system)?</span></font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;">Thanks,</span></font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(42, 0, 255); "><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;">Carl</span></font></font></div></div></div></div></blockquote></div><br></div></body></html>