<?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 Re: Creating Rule Package With Dropdown of Texture Options in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-rule-package-with-dropdown-of-texture/m-p/1577729#M11498</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/833354"&gt;@Kayleigh_T&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;See the snippet below for a minimal solution. Instead of storing the list of textures as const array you could also read from a CSV file with the same structure. In the RPK creation dialog you then need to make sure everything is included under "Additional Files".&lt;/P&gt;&lt;LI-CODE lang="python"&gt;@Enum (valuesAttr = textureNames)
attr selectedTexture = textureNames[0]
@Hidden
attr textureNames = textureArray[[0:2:size(textureArray)-1]]

const texturePath = "/ESRI.lib/assets/Fences/Textures/"
// for many texture consider reading from a CSV
const textureArray = [
	"brick", "brick_01.jpg";
	"brick2", "brick_03.jpg";
	"stone", "stone_01.jpg" 
]

@StartRule
Lot --&amp;gt;
	primitiveCube()
	texture(texturePath+textureArray[findFirst(textureArray, selectedTexture)+1])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Cheers&lt;BR /&gt;Jonas&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2025 09:32:13 GMT</pubDate>
    <dc:creator>JonasObertuefer</dc:creator>
    <dc:date>2025-01-22T09:32:13Z</dc:date>
    <item>
      <title>Creating Rule Package With Dropdown of Texture Options</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-rule-package-with-dropdown-of-texture/m-p/1571852#M11486</link>
      <description>&lt;P&gt;I am attempting to create a rule package that contains a variety of textures that will be selectable in a dropdown list under the inspector tab using an ESRI texture package for signs. I am able to add the texture names under the Enum function, however, I am unsure where I would insert the texture link within the code that the Enum would draw from. The code I have is attached in the screenshots below. I am relatively new to CityEngine and CGA so any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2024-12-31 090714.png" style="width: 314px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122544i04188159CFFC1DF2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-12-31 090714.png" alt="Screenshot 2024-12-31 090714.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2024-12-31 090804.png" style="width: 418px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122545i7FBE9DD717810C2D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-12-31 090804.png" alt="Screenshot 2024-12-31 090804.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 15:11:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-rule-package-with-dropdown-of-texture/m-p/1571852#M11486</guid>
      <dc:creator>Kayleigh_T</dc:creator>
      <dc:date>2024-12-31T15:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Rule Package With Dropdown of Texture Options</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/creating-rule-package-with-dropdown-of-texture/m-p/1577729#M11498</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/833354"&gt;@Kayleigh_T&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;See the snippet below for a minimal solution. Instead of storing the list of textures as const array you could also read from a CSV file with the same structure. In the RPK creation dialog you then need to make sure everything is included under "Additional Files".&lt;/P&gt;&lt;LI-CODE lang="python"&gt;@Enum (valuesAttr = textureNames)
attr selectedTexture = textureNames[0]
@Hidden
attr textureNames = textureArray[[0:2:size(textureArray)-1]]

const texturePath = "/ESRI.lib/assets/Fences/Textures/"
// for many texture consider reading from a CSV
const textureArray = [
	"brick", "brick_01.jpg";
	"brick2", "brick_03.jpg";
	"stone", "stone_01.jpg" 
]

@StartRule
Lot --&amp;gt;
	primitiveCube()
	texture(texturePath+textureArray[findFirst(textureArray, selectedTexture)+1])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Cheers&lt;BR /&gt;Jonas&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 09:32:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/creating-rule-package-with-dropdown-of-texture/m-p/1577729#M11498</guid>
      <dc:creator>JonasObertuefer</dc:creator>
      <dc:date>2025-01-22T09:32:13Z</dc:date>
    </item>
  </channel>
</rss>

