set problem

310
1
12-25-2019 06:43 PM
chojeo
by
New Contributor

i made this cga

but there is porblem

"  set(Facade_Textures.Usage , "Agricultural") "  

" set(Facade_Textures.Usage , "Office")"

did not working well

that did not apply

what problem


import FFacade_Textures   : "/ESRI.lib/rules/Facades/Facade_Textures.cga" () # completely controlled in rules below

 @StartRule
 
Lot --> 
 
   
 case geometry.area < 100   : 
 
      set(Facade_Textures.Usage , "Agricultural")
  
    extrude (10) Stories
   
   
    else: 
         
  set(Facade_Textures.Usage , "Office")

  extrude (20) Stories
  
        
  
Stories -->
 comp(f){ side: Facade }

Facade -->
 Facade_Textures.Generate

0 Kudos
1 Reply
CherylLau
Esri Regular Contributor

First, there is a typo, which results in a compile error.  In the import line, you probably wanted to write Facade_Textures instead of FFacade_Textures.

Second, set() only sets Facade_Textures.Usage, but Facade_Textures.GroundfloorTexture and Facade_Textures.UpperfloorsTexture also need to be set.  This is because set() only changes the specified attribute and does not change other attributes.  The other attributes are initialized before any rules are derived, so when you call set() on Facade_Textures.Usage, the other attributes will have the values that they were initialized with.  You need to set these attributes as well since getting the correct texture depends on them.

set(Facade_Textures.Usage , "Agricultural")
set(Facade_Textures.GroundfloorTexture, Facade_Textures.getGroundfloorTexture)
set(Facade_Textures.UpperfloorsTexture, Facade_Textures.getUpperfloorsTexture)
set(Facade_Textures.Usage , "Office")
set(Facade_Textures.GroundfloorTexture, Facade_Textures.getGroundfloorTexture)
set(Facade_Textures.UpperfloorsTexture, Facade_Textures.getUpperfloorsTexture)
0 Kudos