receiving "No case selected" error window when trying to execute scripts

  • noveln
  • Topic Author
More
30 Oct 2012 01:33 #988 by noveln
Hello all,

Please pardon my utter new-ness at scripting in SAM (or at scripting in general). I'm attempting to batch-simulate configurations of an HCPV system with different combinations of shading maps and min/max tracking angles, and I'm using the sample file "Basic Scripting Language Features.zsam" as a starting point.

When I try to execute scripts, a window pops up, saying "No case selected." It happens even when I run the sample scripts with no modifications. For awhile, it seemed that if I manually ran a base case simulation, the next script I tried to execute would run, but now they all fail in this same way--both the sample scripts and my own.

I'm using climate location files from the SAM directory, and the file I'm working on is not in the SAM directory, but even when I try running the sample file straight from the directory of samples, I get the error.

Is there perhaps a file path designation that I'm missing? I feel like the issue must be something basic like that, but I'm stuck. Any help is much appreciated.

Thanks,
Nick.

Please Log in or Create an account to join the conversation.

  • pgilman
More
31 Oct 2012 11:38 #989 by pgilman
Hi Nick,

Somewhere before you call the Simulate(), you should call SetActiveCase() so that the script knows which case in your SAM file to run.

For example:

SetActiveCase("My PVWatts Case")
Simulate()

Please see the Help topic "Interfacing with SAM Analyses" under "Batch Processing, SamUL" for more details.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

  • noveln
  • Topic Author
More
01 Nov 2012 13:33 #990 by noveln

Ah, yes, I noticed that function in the sample scripts, and made sure to include it in my own. This problem comes up with both my code, and the sample scripts alike.

Does it matter if there are other lines of code in between SetActiveCase and Simulate?

Thanks again,
Nick.

Please Log in or Create an account to join the conversation.

  • pgilman
More
02 Nov 2012 10:08 #991 by pgilman
Not at all. Other functions like SetInput() and GetInput() also require the SetActiveCase() function, so in most cases you would have lines of code between the the SetActiveCase() and Simulate() functions.

You can see examples of scripts in the SamUL Help topic, and in the SamUL Case Study sample file.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: pgilman
Powered by Kunena Forum