I found a problem that I used the same name of attribute in CGA rule and shape,but I couldn't connect the attribute.While the shp source file is in the directory of data in same project
The CGA file is follow
/**
* File: rule.cga
* Created: 2 Aug 2018 01:10:56 GMT
* Author: hp
*/
version "2014.0"
#@Group("floor") @Description("建筑物高度")
attr floor=1 #This attribute is used to generate 3D model and there is the same name of attribute in the shape file
@Group("Settings") @Order(1) @Description("设置显示比例")
attr Scale=1
@Group("Settings") @Rand(0,1) @Order(2) @Description("设置透明度")
attr Opacity=1
@Group("Settings")@Range("whiteToBlack","greenToRed","yellowToRed","redToBlue","orangeToBlue","brownToBlue") @Order(3) @Description("设置填充颜色")
attr ColorRamp= "yellowToRed"
@Group("Settings") @Order(4) @Description("设置颜色范围")
attr ColorRange=1000
Lot-->
color(colorRamp(ColorRamp,floor/ColorRange))//赋不同的颜色
set(material.opacity,Opacity)//设置透明度
extrude(world.y,floor*Scale/100)//设置拉伸高度