First time here? Check out the Help page!
1 | initial version |
Yes, in the end, I was able to do initialization checks on these entities:
model_curve_check = model.getCurveByName(curve_name.get)
library_curve_check = library_model.getObjectByTypeAndName(OpenStudio::Model::CurveBiquadratic::iddObjectType,curve_name.get)
And if these curves exist, I can do any work I want on them by doing the following:
if model_curve_check.is_initialized and library_curve_check.is_initialized then
model_curve = model_curve_check.get.to_CurveBiquadratic.get
library_curve = library_curve_check.get.to_CurveBiquadratic.get
library_coefficient1 = library_curve.coefficient1Constant()
if library_coefficient1 != "" then
model_curve.setCoefficient1Constant(library_coefficient1)
end
model_chiller.setCoolingCapacityFunctionOfTemperature(model_curve)
end
And if only the library curve exists, then I do the following:
if not model_curve_check.is_initialized and library_curve_check.is_initialized then
library_curve = library_curve_check.get.to_ModelObject.get.clone(model).to_CurveBiquadratic.get
model_chiller.setCoolingCapacityFunctionOfTemperature(library_curve)
end
I even encapsulated this in its own function, one for biquadratic, one for quadratic.
This seems to work reasonably well now.