How do I modify Openstudio Model object parameters not found in SDK?
Hi all,
Throughout my OpenStudio development I have been finding I run into cases where I know an OS object has a parameter but I'm not finding a way to modify it when I look through the SDK. To give an example, SolarCollector:FlatePlate:Water has a parameter for its area. However, if I go to the SDK and look at SolarCollector:FlatePlate:Water's functions (and through the inherited functions), there doesn't appear to be one to modify its area.
In cases like these, is there an easy way to go in and modify the actual raw string representing the OS object? I figure there must be a way to output the OS object as a string, modify it, and cast it back to an OS object. Other examples of when I've had trouble with this is when trying to find outlet node of a water heater mixed object to use as the Stream 2 Source Node on a tempering valve.
Any advice?
Is area an input for SolarCollector:FlatPlate:Water? Does it not derive its area from the associated surface? More generally, if you open the OSM file in a text editor and can see the parameter you are trying to assign that doesn't have a method for altering it, then you can call the setString(index, string) where index is the index of the parameter for the object and string is the string you want to pass in.
Thanks so much for the reply! I didn't think it did either until I was receiving warnings that my solar collector's area did not match my surface's area. Opening up OS I looked and saw this. Thankfully it seems like OS defaults to the area of the surface anyhow, but it was something that bugged me.
That setString parameter seems to be what I'm looking for! I didn't know it existed. As a quick follow up, is there a getString(index) function as well? I wonder what other useful functions I didn't know existed are out there (eg: get<os:object>s returns an array)
That is the SolarCollectorPerformance:FlatPlate object, which is different from the object you mention above in that it takes a reference area as seen in the documentation, but as it states, it still uses the surfaces area for calculation.
Yes, there is a getString method! I typically use the C# bindings and have found the intellisense in Visual Studio helps discover methods that aren't all that obvious.
Oh look at that, you're totally right. I was wondering why they kept being defaulted to 2.9646 m2. Maybe I'll do some more digging if need be to see why it's not matching my surface area. Anyhow, lots of help here. Thanks, pflaumingo