Adding object names to a list rather than just their values
Hi Guys,
I'm currently using a script to create a set of polygons (the number of polygons changes each time the script is executed). The area of these polygons can then be adjusted using a pre-existing slider. As a later part of the script, I wanted to add the polygon objects (poly1, poly2 etc.) to a list so that I could quickly calculate the sum of their areas. However, if I use SetValue and Append while creating the list of polygons, it seems to append only the value of the area without actually linking the object's information (ie when I adjust the slider which changes the polygons' area later on, the values in the polygon list don't change).
Execute(Sequence("SetValue(areaList, Append(areaList, poly" + i + "))", i, 1, s))
Is it possible to use scripting to create the list, areaList={poly1, poly2,...} rather than a static list of their areas? Thanks!
The whole point of SetValue is to NOT get a dependence, so you don't want to use it here. Just construct the proper string for the list you want, e.g.:
try naming the polygons A1,A2,A3,A4 and defining the list {A1,A2,A3,A4}
Comments have been locked on this page!