create an attribute which is a string list containing all the values for the different Shapes

666
1
06-19-2017 04:25 AM
SHUBHAMPAWAR
New Contributor

I have divide the building into a stack of 3D cubes (say 3 by 3). How to create an attribute which is a string list containing all the values for the different cubes that I have create ?

please provide CGA rule for this

0 Kudos
1 Reply
CherylLau
Esri Regular Contributor

Here is an excerpt from the help doc defining a string list.

Stringlists are a series of strings stored inside one string. The elements are separated by a semicolon (";"). Each item must be followed by a semicolon, also the last one! The data type is "string", thus it is not an array as used in other scripting languages.

listAdd 

You can either write the string list manually, import the data from somewhere else, write a python script to create the list, or compose it in CGA.  In CGA, there are string list functions which may be helpful.  For example, listAdd adds elements to a list.  String concatenation using the + operator between two strings could also be used.  Recursion may help to build the list.

Here's a simple example on how to make a string list containing n random numbers in the range [0,100].

myList(n) =
     case n==0:
          ""
     else:
          rint(rand(0,100)) + ";" + myList(n-1)

To get a list of 10 random numbers, you would do the following:

myList(10)
0 Kudos