<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic create an attribute which is a string list containing all the values for the different Shapes in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/create-an-attribute-which-is-a-string-list/m-p/604067#M8092</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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 ?&lt;/P&gt;&lt;P&gt;please provide CGA rule for this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jun 2017 11:25:22 GMT</pubDate>
    <dc:creator>SHUBHAMPAWAR</dc:creator>
    <dc:date>2017-06-19T11:25:22Z</dc:date>
    <item>
      <title>create an attribute which is a string list containing all the values for the different Shapes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/create-an-attribute-which-is-a-string-list/m-p/604067#M8092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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 ?&lt;/P&gt;&lt;P&gt;please provide CGA rule for this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jun 2017 11:25:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/create-an-attribute-which-is-a-string-list/m-p/604067#M8092</guid>
      <dc:creator>SHUBHAMPAWAR</dc:creator>
      <dc:date>2017-06-19T11:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: create an attribute which is a string list containing all the values for the different Shapes</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/create-an-attribute-which-is-a-string-list/m-p/604068#M8093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an excerpt from the help doc defining a string list.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #fffae7; text-indent: 20px; font-size: 14.4px;"&gt;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.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/cgareference/celib/listAdd.html" title="http://cehelp.esri.com/help/topic/com.procedural.cityengine.help/html/cgareference/celib/listAdd.html" rel="nofollow noopener noreferrer" target="_blank"&gt;listAdd&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &amp;nbsp;In CGA, there are string list functions which may be helpful. &amp;nbsp;For example, listAdd adds elements to a list. &amp;nbsp;String concatenation using the + operator between two strings could also be used. &amp;nbsp;Recursion may help to build the list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a simple example on how to make a string list containing n&amp;nbsp;random numbers in the range [0,100].&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;myList(n) =
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case n==0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rint(rand(0,100)) + ";" + myList(n-1)
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To get a list of 10 random numbers, you would do the following:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;myList(10)&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:54:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/create-an-attribute-which-is-a-string-list/m-p/604068#M8093</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2021-12-12T01:54:14Z</dc:date>
    </item>
  </channel>
</rss>

