<?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: Map Attributes from rules in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/map-attributes-from-rules/m-p/48691#M659</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hey !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that's easy to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;just create a new Map Layer of the 'mapping type'. choose your image file and create an attribute in the dialog. once the layer has been generated, you can check (and edit) the layer attributes in the Inspector.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;usually, I create mapped attributes based on the image brightness, then create a simple function which maps that value range from 0-1 to a desired range, e.g. 300 x brightness + 20&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;once this is created, point your CGA rule via the Attribute Connection Editor to the specific layer's target attr value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;don't forget to initialize the attr in your rule too ! (e.g. just attr mappedHeight = 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;let me know if it works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Apr 2012 06:49:58 GMT</pubDate>
    <dc:creator>MatthiasBuehler1</dc:creator>
    <dc:date>2012-04-30T06:49:58Z</dc:date>
    <item>
      <title>Map Attributes from rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/map-attributes-from-rules/m-p/48690#M658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do I have a cga rule attribute retrieve and use a value from a particular source Layer, if I do not want to set a shapes attribute source manually in the Inspector?(I may want to use different image maps (sources) to control a particular attribute under different rule conditions)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cgaFile - pseudoCode:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;attr value=getValueFromLayer(Layer, Layer_Attribute)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;attr height=getValueFromLayer("map1", "buildingHeight") &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry if this is very obvious, I'm getting lost in the help documentation and the way some of it is written.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Apr 2012 23:38:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/map-attributes-from-rules/m-p/48690#M658</guid>
      <dc:creator>RobertHexter</dc:creator>
      <dc:date>2012-04-28T23:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Map Attributes from rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/map-attributes-from-rules/m-p/48691#M659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hey !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that's easy to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;just create a new Map Layer of the 'mapping type'. choose your image file and create an attribute in the dialog. once the layer has been generated, you can check (and edit) the layer attributes in the Inspector.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;usually, I create mapped attributes based on the image brightness, then create a simple function which maps that value range from 0-1 to a desired range, e.g. 300 x brightness + 20&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;once this is created, point your CGA rule via the Attribute Connection Editor to the specific layer's target attr value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;don't forget to initialize the attr in your rule too ! (e.g. just attr mappedHeight = 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;let me know if it works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 06:49:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/map-attributes-from-rules/m-p/48691#M659</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2012-04-30T06:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Map Attributes from rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/map-attributes-from-rules/m-p/48692#M660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am confused by this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;point your CGA rule via the Attribute Connection Editor to the specific layer's target attr value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I have this initialized in my rule:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;attr mappedHeight = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;how do I:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;point your CGA rule via the Attribute Connection Editor&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am currently only understanding this to be a manual process of changing the shapes attribute source input within the Attribute Connection Editor?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to have the rule tell the shape what its specific layer/map and attribute of interest is, not do it myself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am confused because I want to, within my rule, have the rule determine the connection to which mapLayer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//set/connect the shapes "mappedHeight" attribute, to the MapLayers attribute "mappedHeight", where MapLayer is determined by something else..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set(shape.mappedHeight, MapLayer.mappedHeight)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 16:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/map-attributes-from-rules/m-p/48692#M660</guid>
      <dc:creator>RobertHexter</dc:creator>
      <dc:date>2012-04-30T16:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Map Attributes from rules</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/map-attributes-from-rules/m-p/48693#M661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;first step : check the following manual page, it shows the Connection Editor basics :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Help &amp;gt; Manual &amp;gt; Mapping Attributes &amp;gt; Mapping Attributes with Connection Editor&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ check the attr icon with the black triangle pointing in a rectangle ]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;additionally :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;it is important to understand that &lt;/SPAN&gt;&lt;STRONG&gt;CityEngine uses some heuristics to find the right connections automatically &lt;/STRONG&gt;&lt;SPAN&gt; when a rule is assigned to a shape :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you assign a rule e.g. to a 'Lot' via Drag'n'Drop, CityEngine checks if :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1st priority] an Object Attr exists for the initialized attrs. If so, the connection automatically is made to the Object Attr&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2nd priority] a Map Layer attribute exists for the initialized attrs. If so, the connection automatically is made to the corresponding Map Layer attr&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3rd priority] the Rule value is used&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this helps you further !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;oh, and also good to know, the @StartRule annotation adapts some behavior : Once drag-n-dropped and a StartRule is defined within a cga rule file, the model generation is directly triggered ( great for demos ! ).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;let me know if questions remain.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 18:13:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/map-attributes-from-rules/m-p/48693#M661</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2012-04-30T18:13:28Z</dc:date>
    </item>
  </channel>
</rss>

