Creating Color Gradient in Max related to Size

I have no experience with Max script, but a bit of experience with VB Script. I was wondering if there was anyway to generate a color pattern as you did here but by linking it to the size of an opening as you can see in this image.

Color Gradient

The Max script for this effect can be found here:

Maxforums - Maxscript fun: A couple of examples - page 1


This facade was generated with a parametric software plugin for Rhino called Grasshopper. I have the ability to assign color values to the curves that where the base of this mesh, or export color information into excel. I am considering 2 solutions but any other possibilities are welcome:

Solution 1:

Is it possible to link Max to Excel through a vb script and then link a list of objects to a list in excel? There would need to be some way to rationally order the poygons of the mesh into a matrix  via cartisian co-ordinates so that I could map the interior edges of the facade with a matrix of values in Excel.  This could wither by a list of rows and columns or a flat list. I'm not familar with the way that max stores information about its geometry.  See link below:

Numbered Polygons

Solution 2:

Is it possible to "call" color values from a polyline curve and then use these RGB values to generate a material?

colored curves

Without any experience with Max script I don't know where to start and whether or not this request would be complex or difficult to execute. Any help or advice would be greatly appreciated!