- Posts: 1
Automating SAM with LK script
- charlybit
- Topic Author
Less
More
15 May 2020 03:20 #8200
by charlybit
Automating SAM with LK script was created by charlybit
Hi,
Is there any way to run a LK script without graphical interface? I've prepared a LK script that read some files to adjust some parameteres for the simulation and also to get the results as a CSV file.
This works fine but my purpose is doing this whout graphifcal inteface, like command line (thouhght SDK or pysam or something).
Is there any way to do this? Is posible to run a script via samtools, pysam, sdk, ...?
Thanks in advance,
Carlos.
Is there any way to run a LK script without graphical interface? I've prepared a LK script that read some files to adjust some parameteres for the simulation and also to get the results as a CSV file.
This works fine but my purpose is doing this whout graphifcal inteface, like command line (thouhght SDK or pysam or something).
Is there any way to do this? Is posible to run a script via samtools, pysam, sdk, ...?
Thanks in advance,
Carlos.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5427
15 May 2020 14:21 #8206
by pgilman
Replied by pgilman on topic Automating SAM with LK script
Hi Carlos,
We are working implementing the capability to run an LK script from the command line. Please see this GitHub.com Issue for more information:
github.com/NREL/SAM/issues/309
In the meantime, the only option for running an LK script outside of the SAM desktop application is to use SDKtool as described on the SAM SDK page of the SAM website:
sam.nrel.gov/sdk
Note that LK is slightly different in different contexts. For example in a script made to run in SAM, you use set() and get() to set and get values of variables. In LK for SDKtool, you use var(). The function reference in each environment lists the functions that work in that environment.
Best regards,
Paul.
We are working implementing the capability to run an LK script from the command line. Please see this GitHub.com Issue for more information:
github.com/NREL/SAM/issues/309
In the meantime, the only option for running an LK script outside of the SAM desktop application is to use SDKtool as described on the SAM SDK page of the SAM website:
sam.nrel.gov/sdk
Note that LK is slightly different in different contexts. For example in a script made to run in SAM, you use set() and get() to set and get values of variables. In LK for SDKtool, you use var(). The function reference in each environment lists the functions that work in that environment.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- Fernández
Less
More
- Posts: 3
11 Jun 2020 09:09 #8299
by Fernández
Replied by Fernández on topic Automating SAM with LK script
Hi Paul,
I have seen the issue github.com/NREL/SAM/issues/309 has been closed.
I have two doubts:
1. The command line is for lk for sam or lk for sdk?
2. How would a command line script be launched? Is it only for linux?
If I run ./sam.bin in linux it returns the following error:
error while loading shared libraries: ssc.so: cannot open shared object file: No such file or directory
Thank you!
Juan.
I have seen the issue github.com/NREL/SAM/issues/309 has been closed.
I have two doubts:
1. The command line is for lk for sam or lk for sdk?
2. How would a command line script be launched? Is it only for linux?
If I run ./sam.bin in linux it returns the following error:
error while loading shared libraries: ssc.so: cannot open shared object file: No such file or directory
Thank you!
Juan.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5427
15 Jun 2020 13:32 #8306
by pgilman
Replied by pgilman on topic Automating SAM with LK script
Dear Juan,
The milestone associated with GitHub Issue #309 is "2020 Patch 3" which indicates that it will be included as part of the third update to SAM 2020.2.29, which we have not yet released. We are currently on SAM 2020.2.29 Revision 2 -- that update will be SAM 2020.2.29 Revision 3.
We will release Revision 3 soon, when we have fixed any remaining issues with SAM 2020.2.29 Revision 2.
Best regards,
Paul.
The milestone associated with GitHub Issue #309 is "2020 Patch 3" which indicates that it will be included as part of the third update to SAM 2020.2.29, which we have not yet released. We are currently on SAM 2020.2.29 Revision 2 -- that update will be SAM 2020.2.29 Revision 3.
We will release Revision 3 soon, when we have fixed any remaining issues with SAM 2020.2.29 Revision 2.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5427
31 Jul 2020 16:00 - 31 Jul 2020 16:22 #8514
by pgilman
Replied by pgilman on topic Automating SAM with LK script
Dear Juan,
As of SAM 2020.2.29 r3, released today, you can run an LK script from the command line. The syntax is:
[path to SAM executable] [any string] [path to .lk script file]
Note the spaces between each parameter.
For example, in Windows, the command might look like this:
c:/sam/2020.2.29/x64/sam.exe not-a-sam-file c:/test.lk
Running that in a Command or Terminal window will start the SAM desktop application, open the .lk file in a script editor and run the script (equivalent to clicking the Run button in the script editor). The middle parameter is required (it can be any string), but does not do anything. You have to manually close SAM when you are finished.
You can also use the following to open a .sam file from the command line:
[path to SAM executable] [path to .sam file]
Best regards,
Paul.
As of SAM 2020.2.29 r3, released today, you can run an LK script from the command line. The syntax is:
[path to SAM executable] [any string] [path to .lk script file]
Note the spaces between each parameter.
For example, in Windows, the command might look like this:
c:/sam/2020.2.29/x64/sam.exe not-a-sam-file c:/test.lk
Running that in a Command or Terminal window will start the SAM desktop application, open the .lk file in a script editor and run the script (equivalent to clicking the Run button in the script editor). The middle parameter is required (it can be any string), but does not do anything. You have to manually close SAM when you are finished.
You can also use the following to open a .sam file from the command line:
[path to SAM executable] [path to .sam file]
Best regards,
Paul.
Last edit: 31 Jul 2020 16:22 by pgilman.
Please Log in or Create an account to join the conversation.
- joel3003
Less
More
- Posts: 9
08 Dec 2020 19:20 #9074
by joel3003
Replied by joel3003 on topic Automating SAM with LK script
Hi,
Is there any way to run an LK script from a .sam file in the command line. Currently I can use [path to SAM executable] [any string] [path to .lk script file] however I would like to be able to run an LK script based on parameters in a particular .sam file. For instance, something like [path to .sam] [path to .lk script file]. Is this possible?
Thanks
Is there any way to run an LK script from a .sam file in the command line. Currently I can use [path to SAM executable] [any string] [path to .lk script file] however I would like to be able to run an LK script based on parameters in a particular .sam file. For instance, something like [path to .sam] [path to .lk script file]. Is this possible?
Thanks
Please Log in or Create an account to join the conversation.
Moderators: pgilman