Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline johnpan  
#1 Posted : 19 May 2022 16:33:16(UTC)
johnpan


Rank: Member

Groups: Registered
Joined: 01/01/2022(UTC)
Posts: 12
China

Hi

Is it possible to pack the smath studio in my software as a calculation engine at background? transfer my parameter into the sheet? produce the pdf of result?

thanks a lot!
John

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline alyles  
#2 Posted : 19 May 2022 19:44:09(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 276
United States

Was thanked: 91 time(s) in 57 post(s)
I know it's possible to run Smath from the command line and save as a specific output. What I am not sure about is whether or not you can pass parameters into the sheet using -o.
If you look in the reference book under Program Operation -> Silent Mode and Command Line Options you will get more info.

Untitled.png
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline alyles  
#3 Posted : 19 May 2022 20:34:59(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 276
United States

Was thanked: 91 time(s) in 57 post(s)
So I was able to do this in a couple steps.

I put my inputs into a file called "input.txt". Then I created a .sm called "calc.sm" that read input from the input.txt file and performed a calculation.

The command line looked like this:

input.png

I have attached the .txt, .sm and .pdf files as well.
calc.pdf (22kb) downloaded 19 time(s).
calc.sm (4kb) downloaded 15 time(s).
input.txt (1kb) downloaded 18 time(s).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline alyles  
#4 Posted : 19 May 2022 20:57:14(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 276
United States

Was thanked: 91 time(s) in 57 post(s)
Perhaps improving on this concept a bit. I've added some commands to point the current working directory to the document directory. This way you can save the input.txt and calc.sm in the same folder. That way you could call:

SmathStudio_Desktop.exe -silent pathtosmfile -e pdf

and as long as the input file is in the same folder you don't have to point to the absolute path of the file. This makes it more portable.

Untitled.png

calc.sm (4kb) downloaded 6 time(s).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline alyles  
#5 Posted : 19 May 2022 22:39:24(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 276
United States

Was thanked: 91 time(s) in 57 post(s)
Originally Posted by: johnpan Go to Quoted Post
Hi

Is it possible to pack the smath studio in my software as a calculation engine at background? transfer my parameter into the sheet? produce the pdf of result?

thanks a lot!
John


Re-reading this, yes it is possible, however, if your software is intended to be distributed, you must be careful how you package this as to not violate the license agreement. Only unmodified installer may be redistributed.
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline johnpan  
#6 Posted : 20 May 2022 04:25:41(UTC)
johnpan


Rank: Member

Groups: Registered
Joined: 01/01/2022(UTC)
Posts: 12
China

Hi, alyles

thank you for the detail and sample. good idea for me.

Yes, I'm care about the software license. thank you for the notice.

BR

John
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.