Creating a large number of structures with different names


In some situations you might be interested in creating a large number of structures and assign each of them a particular name, visible in the Object tree. For example, imagine you wanted to create a periodic array of cylinders, where each cylinder is identified by a number:

In principle you could do that following the approach described in:

These approaches work very well even if you have a large number of structures in the array. However, all the structures will be named in the same way, “circle”, in the Object tree. If you want to have different names for each object, you can rename them using a script; however, running such a script could take a long time if the renaming procedure is not done in an efficient way.

I have attached a script that allows you to create an array of cylinders where each one has a different name in the object tree. The script creates one column at a time and renames all the elements in the column before proceeding to the next one. This method turns out to be more efficient than creating the entire array and going through it renaming each element. For small arrays the method’s efficiency is not noticeable, but if you try a huge array, for example of 81x81 elements, then the speed up is significant.

many_circles.lsf (1.3 KB)

Speed up GUI when making large number of objects