How to find OSM file location from a measure?
I'm writing a measure to write CSV files to the OSM file folder and wondering if there's a way to find the location of the OSM file? Since OS uses the C:\Users\<UserName>\AppData\Local\Temp
folder during a sim, using the location of the measure.rb
file returns the Temp folder instead of the location of the actual OSM file. For example, a new reporting measure uses the code below to read/write to the measure folder.
html_in_path = "#{File.dirname(__FILE__)}/resources/report.html.in"
I'm using the following syntax to move up folders to write to a higher level of the directory. However, when the path is written out it shows the Temp folder path.
html_root_dir = "#{File.expand_path("../../../", __FILE__)}"
puts html_root_dir
HTML ROOT DIR = C:/USERS/MATT/APPDATA/LOCAL/TEMP/OPENSTUDIO.A17988/RESOURCES/RUN
The main block of Ruby code from the measure will function as intended if executed from a terminal outside of a simulation.