Sha256: 118dcb66c0408adb5811130dcb305b1fa2118cf2d94db02a0777df24bf58c1f2

Contents?: true

Size: 731 Bytes

Versions: 23

Compression:

Stored size: 731 Bytes

Contents

require 'openstudio'
require_relative '../../openstudio-standards/btap/btap'
require_relative '../../openstudio-standards/btap/fileio'

puts "\nenter osm file name (without file extension):\n"
# osm_infile_name = gets.chomp
osm_infile_name = 'NECB2011Hospital'
osm_outfile_name = osm_infile_name.to_s + '_updated.osm'

model = BTAP::FileIO.safe_load_model("#{osm_infile_name}.osm")

spaces = model.getSpaces

spaces.each do |space|
  surfaces = space.surfaces()
  surfaces.each_with_index do |surface, index|
    name = "#{space.nameString}-#{index}-#{surface.surfaceType}"
    puts name
    surface.setName(name)
  end
end

osm_path = OpenStudio::Path.new(osm_outfile_name.to_s)
model.save(osm_path, true)

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
openstudio-standards-0.7.1 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.7.0 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.7.0.rc1 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.6.3 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.6.0.rc2 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.6.0.rc1 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.5.0 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.5.0.rc1 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.4.0 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.3.1.rc2 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.3.1.rc1 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.3.0 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.2.17.rc2 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.2.17.rc1 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.2.16 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.2.16.rc2 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.2.16.rc1 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.2.15 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.2.15.pre.rc2 lib/openstudio-standards/btap/utilities/rename_surfaces.rb
openstudio-standards-0.2.15.pre.rc1 lib/openstudio-standards/btap/utilities/rename_surfaces.rb