I do have another question for you afterall. I have brought in a layer of all of the building floors, it contains information about the elevation of the floor of the floor and also has the height of the floor. This is very important because our buildings have irregular interstitials that have been requested to be modled true to form. I was able to create a rule to extrude each floor by the height attribute. Im stuck on trying to determine how to assign the elevations in the attributes as the "heightmap", the elevation that floor should sit on. I want this to be independant of my terrain so I assume that it has to be added to the rule. I found some information online stating that there was a way to do this but the token settings.setHeightmap say that it is undefined. Very confused: below is an example of where Im currently at:
#This attribute should be "sourced" to the object attribute
attr Height = 0
attr Elevation = 0
@StartRule
Lot -->
extrude (Height)
volume.
This is the example I atempted to use but I guess I dont understand it:
alignShapes(self, shapes, settings=None)Aligns a set of shapes.
@param shapes: The set of shapes to align.
@param settings: The align settings. Omit to use default settings. (default = None).
@note: # align shapes of layer 'Lots' to layer 'Heightmap'
lotLayer = ce.getObjectsFrom(ce.scene, ce.isLayer, ce.withName("'Lots'"))
settings = AlignShapesSettings()
settings.setHeightmap('Heightmap')
settings.setAlignFunction(AlignShapesSettings.TRANSLATE_TO_MIN)
ce.alignShapes(lotLayer, settings)
I have another question for you. So all above worked but I was in a sandbox scene. I brought the data into the scene that I want it to reside in and the buildings are floating above the surface of the terrain. I double checked the values for known areas and the pixels in the terrain match floor elevations within a 1/4 foot (3 inches). They are about 20-30 feet off in the scene. I know that value because I found a building with two underground levels each ~ 10 feet in height with the lowest sitting extremely close to the terrain. Any thoughts on what the issue here could be? Or how to resolve it? I also checked all the projections in ArcMap XYZ and they are identical. 😕
CGA rules always output meters regardless of scene units, so if your input is in feet, then use this to convert the feet input in your rules:
1 foot = 0.3048meters
so put your feet through this conversion, and use those meter values within your rule...
convertFeetToMeters(feet) = feet * 0.3048
I was actually just about to tell you to disregard that. The group that I get the floor data from specified that they enabled the ZCoordSytem when they hadnt. I posted to quick reprojecting solved the issue.
Hi Chris can I ask you another question about syntax?
Im trying to use the same elevation data listed above to create a rule to color the floors by elevation. I only want to use 20 shades and already calculated the correct values for each standard deviation.
The issue that I am having is with the proper syntax to combine simple float comparison operators.
For example: Works perfectly
@StartRule
BuildingByElevation -->
t(0,((Elevation)/3.28084),0)
extrude ((Height)/3.28084)
comp (f) {all:AllComponents}
AllComponents -->
case Elevation >950 : color (0,230,0)
else: PrintInfo
But how do I specify, for example, Elevation >=950 and <=1000?
I have tried all the methods that I can think of and am at a loss.
case Elevation >= 950 && Elevation <=1000:
If you are to make many of these in a row, make one of them have no equality as in this:
case Elevation >= 700 && Elevation <950: # this one does not catch 950
case Elevation >= 950 && Elevation <1000: # this one catches 950
Fantastic!!!! I couldnt find it searching for my life, I tried "complex comparison operator" and a few others what would be the best way to search something like this in the future?
F1 for Help.
On table of contents to the left, expand CGA Shape Grammar Reference.
See "Simple Type Operations".
So I tried to use the expression but Im not sure that it is grabbing (in the example you used) only the values 700 to 949. Everything in my model is symbolized with the highest elevations color assignment. I have 25 SD and all appear the same.
A bit more info, I added parenthesis around the expression, the results were different but still made little sense. some floors became grey (my default if there is no value) but all of floors have values thats where I got the range of values from. the rest remained the same color as was assigned to higest elevation.
Also the "not catch" example you gave me the "not catch 950" and the "950" all items are flagged as unexpected tokens.