Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Add Photovoltaics User Script

I use Sketchup OpenStudio Plug-in for BIPV system energy production estimates. Most simulations consist of BIPV surfaces on multiple building facades. Therefore it would be very handy to be able to add customs names to the "Choose Electric Load Center Distribution." drop down list. This is part of the "Add Photovoltaics" User Script – Extensions->OpenStudio User Scripts->Alter or Add Model Elements->Add Photovoltaics. This way after simulation is done, in DView I could easier read the timeseries graphs with the legend containing the custom names instead of "ELECTRIC LOAD CENTER INVERTER SIMPLE 1."

I have located the "Add Photovoltaics" ruby script code here C:\Users\%userprofile%\AppData\Roaming\SketchUp\SketchUp 2019\SketchUp\Plugins\openstudio\user_scripts\Alter or Add Model Elements

It would seem to me that I could simply add another field into the "Add Photovoltaics" User Script and use this field to append the StringVector (elcd_names) with my own custom string value (mock-up)?

This is the part of the "Add Photovoltaics" User Ruby Script that deals with the "Choose Electric Load Center Distribution." drop down list:

def arguments(model)
result = OpenStudio::Ruleset::OSArgumentVector.new

elcd_hash = Hash.new
model.getElectricLoadCenterDistributions.each do |elcd|
  elcd_hash[elcd.name.get] = elcd
end

elcd_handles = OpenStudio::StringVector.new
elcd_names = OpenStudio::StringVector.new

elcd_handles << OpenStudio::toUUID("").to_s
elcd_names << "*New Electric Load Center Distribution*"

elcd_hash.sort.map do |elcd_name, elcd|
  elcd_handles << elcd.handle.to_s
  elcd_names << elcd_name
end

elcd = OpenStudio::Ruleset::OSArgument::makeChoiceArgument("elcd", elcd_handles, elcd_names, true)
elcd.setDisplayName("Choose Electric Load Center Distribution.")
elcd.setDefaultValue("*New Electric Load Center Distribution*")
result << elcd

Add Photovoltaics User Script

I use Sketchup OpenStudio Plug-in for BIPV system energy production estimates. Most simulations consist of BIPV surfaces on multiple building facades. Therefore it would be very handy to be able to add customs names to the "Choose Electric Load Center Distribution." drop down list. This is part of the "Add Photovoltaics" User Script – Extensions->OpenStudio User Scripts->Alter or Add Model Elements->Add Photovoltaics. This way after simulation is done, in DView I could easier read the timeseries graphs with the legend containing the custom names instead of "ELECTRIC LOAD CENTER INVERTER SIMPLE 1."

I have located the "Add Photovoltaics" ruby script code here C:\Users\%userprofile%\AppData\Roaming\SketchUp\SketchUp 2019\SketchUp\Plugins\openstudio\user_scripts\Alter or Add Model Elements

It would seem to me that I could simply add another field into the "Add Photovoltaics" User Script and use this field to append the StringVector (elcd_names) with my own custom string value (mock-up)?

This is the part of the "Add Photovoltaics" User Ruby Script that deals with the "Choose Electric Load Center Distribution." drop down list:

def arguments(model)
result = OpenStudio::Ruleset::OSArgumentVector.new

elcd_hash = Hash.new
model.getElectricLoadCenterDistributions.each do |elcd|
  elcd_hash[elcd.name.get] = elcd
end

elcd_handles = OpenStudio::StringVector.new
elcd_names = OpenStudio::StringVector.new

elcd_handles << OpenStudio::toUUID("").to_s
elcd_names << "*New Electric Load Center Distribution*"

elcd_hash.sort.map do |elcd_name, elcd|
  elcd_handles << elcd.handle.to_s
  elcd_names << elcd_name
end

elcd = OpenStudio::Ruleset::OSArgument::makeChoiceArgument("elcd", elcd_handles, elcd_names, true)
elcd.setDisplayName("Choose Electric Load Center Distribution.")
elcd.setDefaultValue("*New Electric Load Center Distribution*")
result << elcd

Add Photovoltaics User Script

I use Sketchup OpenStudio Plug-in for BIPV system energy production estimates. Most simulations consist of BIPV surfaces on multiple building facades. Therefore it would be very handy to be able to add customs names to the "Choose Electric Load Center Distribution." drop down list. This is part of the "Add Photovoltaics" User Script – Extensions->OpenStudio User Scripts->Alter or Add Model Elements->Add Photovoltaics. This way after simulation is done, in DView I could easier read the timeseries graphs with the legend containing the custom names instead of "ELECTRIC LOAD CENTER INVERTER SIMPLE 1."

I have located the "Add Photovoltaics" ruby script code here C:\Users\%userprofile%\AppData\Roaming\SketchUp\SketchUp 2019\SketchUp\Plugins\openstudio\user_scripts\Alter or Add Model Elements

It would seem to me that I could simply add another field into the "Add Photovoltaics" User Script and use this field to append the StringVector (elcd_names) with my own custom string value (mock-up)?

This is the part of the "Add Photovoltaics" User Ruby Script that deals with the "Choose Electric Load Center Distribution." drop down list:

def arguments(model)
result = OpenStudio::Ruleset::OSArgumentVector.new

elcd_hash = Hash.new
model.getElectricLoadCenterDistributions.each do |elcd|
  elcd_hash[elcd.name.get] = elcd
end

elcd_handles = OpenStudio::StringVector.new
elcd_names = OpenStudio::StringVector.new

elcd_handles << OpenStudio::toUUID("").to_s
elcd_names << "*New Electric Load Center Distribution*"

elcd_hash.sort.map do |elcd_name, elcd|
  elcd_handles << elcd.handle.to_s
  elcd_names << elcd_name
end

elcd = OpenStudio::Ruleset::OSArgument::makeChoiceArgument("elcd", elcd_handles, elcd_names, true)
elcd.setDisplayName("Choose Electric Load Center Distribution.")
elcd.setDefaultValue("*New Electric Load Center Distribution*")
result << elcd

Add Photovoltaics User Script

I use Sketchup OpenStudio Plug-in for BIPV system energy production estimates. Most simulations consist of BIPV surfaces on multiple building facades. Therefore it would be very handy to be able to add customs names to the "Choose Electric Load Center Distribution." drop down list. This is part of the "Add Photovoltaics" User Script – Extensions->OpenStudio User Scripts->Alter or Add Model Elements->Add Photovoltaics. This way after simulation is done, in DView I could easier read the timeseries graphs with the legend containing the custom names instead of "ELECTRIC LOAD CENTER INVERTER SIMPLE 1."

I have located the "Add Photovoltaics" ruby script code here C:\Users\%userprofile%\AppData\Roaming\SketchUp\SketchUp 2019\SketchUp\Plugins\openstudio\user_scripts\Alter or Add Model Elements

It would seem to me that I could simply add another field into the "Add Photovoltaics" User Script and use this field to append the StringVector (elcd_names) with my own custom string value (mock-up)?

This is the part of the "Add Photovoltaics" User Ruby Script that deals with the "Choose Electric Load Center Distribution." drop down list:

def arguments(model)
result = OpenStudio::Ruleset::OSArgumentVector.new

elcd_hash = Hash.new
model.getElectricLoadCenterDistributions.each do |elcd|
  elcd_hash[elcd.name.get] = elcd
end

elcd_handles = OpenStudio::StringVector.new
elcd_names = OpenStudio::StringVector.new

elcd_handles << OpenStudio::toUUID("").to_s
elcd_names << "*New Electric Load Center Distribution*"

elcd_hash.sort.map do |elcd_name, elcd|
  elcd_handles << elcd.handle.to_s
  elcd_names << elcd_name
end

elcd = OpenStudio::Ruleset::OSArgument::makeChoiceArgument("elcd", elcd_handles, elcd_names, true)
elcd.setDisplayName("Choose Electric Load Center Distribution.")
elcd.setDefaultValue("*New Electric Load Center Distribution*")
result << elcd