First time here? Check out the Help page!
1 | initial version |
The method that you want is space.buildingStory
, you can find that in the documentation for the Space object. You will want to do something like this:
#reporting initial condition of model
runner.registerInitialCondition("The building has #{spaces.size} spaces" )
spaces.each do |space|
#story name, space name
building_story= space.buildingStory # returns an optional story, might not be available so need to check below
base_name = "" # needed so you can access this variable outside of the following if statement
if !building_story.empty?
base_name = "#{building_story.name} - #{space.name}"
end
end #end of spaces.each do
2 | No.2 Revision |
The method that you want is space.buildingStory
, you can find that in the documentation for the Space object. You will want to do something like this:
#reporting initial condition of model
runner.registerInitialCondition("The building has #{spaces.size} spaces" )
spaces.each do |space|
#story name, space name
building_story= space.buildingStory # returns an optional story, might not be available so need to check below
base_name = "" # needed so you can access this variable outside of the following if statement
if !building_story.empty?
building_story = building_story.get # dereference the OptionalBuildingStory to get the BuildingStory
base_name = "#{building_story.name} - #{space.name}"
end
end #end of spaces.each do