The example that you linked does not apply to your situation. The outletModelObject
is only available from objects that inherit from the StraightComponent
class, such as the DX:CoolingCoil.
Your ChillerElectricEIR
object is a WaterToWaterComponent
. From your description, I would say that you are trying to put a setpoint manager in the outlet node for the chilled water side of the chiller. Then you would need to use the following:
outlet_node_chw_side = my_chiller.supplyOutletModelObject.get.to_Node.get
You are getting the for #
part of the error because you are not calling correctly the chiller. Try appending .get.to_ChillerElectricEIR.get
to what you are using to select your Chiller.
EDIT: Added example to correctly call the chiller
Is the primaryChiller
object initialized? If it is a new object you are creating (e.g. it is not already in your plantloop) you need to:
primary_chiller = Openstudio::Model::ChillerElectricEIR.new(model)
If it is a chiller that is already in your model, you need to somehow select it. A way of doing this is to add the following code to the appropriate sections of the measure:
## Arguments section
# select chiller
available_chillers = model.getChillerElectricEIRs
available_chillers_handle = OpenStudio::StringVector.new
available_chillers_display_name = OpenStudio::StringVector.new
available_chillers.each do |chiller|
available_chillers_handle << chiller.handle.to_s
available_chillers_display_name << chiller.name.to_s
end
# make an argument for selecting your chiller
selected_chiller = OpenStudio::Ruleset::OSArgument::makeChoiceArgument("selected_chiller", available_chillers_handle , available_chillers_display_name ,false)
selected_chiller.setDisplayName("Select the chiller:")
args << selected_chiller
## Run Section
selected_chiller = runner.getOptionalWorkspaceObjectChoiceValue("selected_chiller",user_arguments,model)
# check the selected_chiller for reasonableness and get it
if selected_chiller.empty?
runner.registerError("The selected chiller was not found in the model.")
return false
else
if not selected_chiller.get.to_ChillerElectricEIR.empty?
primary_chiller = selected_chiller.get.to_ChillerElectricEIR.get
runner.registerInfo("Using chiller #{primary_chiller.name}.")
else
runner.registerError("Script Error - argument not showing up as Chiller.")
return false
end
end
Could you post the code you are using to call the
ChillerElectricEIR
object? It looks like it may be receiving anOptional