Script Region

Script Region - Extends SMath Studio with a Script Region (c#, vb.net, python) - Messaggi

#1 Pubblicato: 20/06/2014 06:30:40
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Script Region

SMath Studio compatibility SMath Viewer compatibility mono compatibility Extension page Sources


C# and VB.Net:
Do not use directive "using". You just need to fill function body.

List of specified namespaces (c#, vn.net):

System
System.IO
System.Diagnostics
System.Xml
System.Linq
System.Text
System.Reflection
System.Collections.Generic
System.Globalization
System.Drawing
System.Drawing.Drawing2D
System.Drawing.Imaging

SMath.Manager
SMath.Controls
SMath.Math
SMath.Math.Numeric

List of specified namespaces (python (import * used)):

System

SMath.Manager
SMath.Controls
SMath.Math
SMath.Math.Numeric

Predefined variables available in script (c#, vn.net, python): Store store.


Links:

1. Fast Colored TextBox for Syntax Highlighting (Pavel Torgashov).
2. Runtime-генерирование .Net-кода для тех, кому некогда (Андрей Мартынов).
3. Scripting .NET Applications with IronPython (Jerome Terry).
4. SMath Studio Core documentation (CHM)

Examples:

Script. CurrentDirectory.sm (5,48 KiB) scaricato 2081 volta(e).
Script. CurrentDirectory.pdf (51,49 KiB) scaricato 1412 volta(e).

Script. Show time.sm (4,89 KiB) scaricato 2008 volta(e).
Script. Show time.pdf (42,99 KiB) scaricato 1326 volta(e).

Script. InOut.sm (8,24 KiB) scaricato 2152 volta(e).
Script. InOut.pdf (30,57 KiB) scaricato 1421 volta(e).
Russia ☭ forever, Viacheslav N. Mezentsev
2 utenti hanno apprezzato questo post
densy 30/12/2021 11:44:00, Davide Carpi 20/06/2014 20:51:00
#2 Pubblicato: 20/06/2014 11:50:01
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Updated.
2014-06-20 21-47-03 SMath Studio Desktop - [CS. Example 1.sm].png
Russia ☭ forever, Viacheslav N. Mezentsev
#3 Pubblicato: 21/06/2014 01:53:48
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Updated. Python also works but w/o syntax highlighting.
2014-06-21 11-47-14 SMath Studio Desktop - [Python. Example 1.sm ].png
Russia ☭ forever, Viacheslav N. Mezentsev
#4 Pubblicato: 28/10/2014 17:10:34
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Updated. Small improvements.

EDIT:

Test (c#).

2017-03-09_12-09-20.png

Script:

Mostra spoiler

Russia ☭ forever, Viacheslav N. Mezentsev
#5 Pubblicato: 01/02/2016 14:08:32
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

The source code has been restored, updated and uploaded to svn. Something does not work yet (last example). The plugin is not available, because Release Manager can't build it (too complex I think).
Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
Davide Carpi 01/02/2016 14:39:00
#6 Pubblicato: 02/02/2016 04:44:50
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Updated (svn). Now last example works and we are waiting when Andrey fix the Release Manager.
Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
Davide Carpi 02/02/2016 19:27:00
#7 Pubblicato: 09/02/2016 01:11:56
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Updated. Now available.
Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
Davide Carpi 09/02/2016 16:36:00
#8 Pubblicato: 23/05/2016 18:12:44
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Hi Uni. Admirable work, thanks a lot for this plugin. Just few questions:

- From where plugin's take c#, vb.net and python ¿(i.e. came when plugin is downloaded)?
- ¿Can call nympi or Sci python?
- ¿Can you show how to modify some SMtah's vector or matrix variable? In other words, ¿there are an output, avoiding handling files, to smath worksheet or only can view results in the trace window?
- Not related with your plugin, but ... easy asking you: SMath don't have maple's traperror or mathcad onerror functions?

Have a nice day.

Alvaro.
#9 Pubblicato: 25/05/2016 04:41:58
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Wrote

- From where plugin's take c#, vb.net and python ¿(i.e. came when plugin is downloaded)?
- ¿Can call nympi or Sci python?
- ¿Can you show how to modify some SMtah's vector or matrix variable? In other words, ¿there are an output, avoiding handling files, to smath worksheet or only can view results in the trace window?


c#, vn.net from the .Net Framework which is already installed on your PC.
As for the python I used IronPython which is a part of the plugin.
Not shure about numpi and Sci. I think it is impossible use them now.

You can modify and add definitions to the worksheet dynamically (inside the script). It not so simple to show how you can use this, I need a time to make an example.

Russia ☭ forever, Viacheslav N. Mezentsev
#10 Pubblicato: 27/05/2016 08:11:50
Tinu_

Tinu_

14 apprezzamenti in 19 post.

Gruppo: User

Wrote


c#, vn.net from the .Net Framework which is already installed on your PC.
As for the python I used IronPython which is a part of the plugin.
Not shure about numpi and Sci. I think it is impossible use them now.

You can modify and add definitions to the worksheet dynamically (inside the script). It not so simple to show how you can use this, I need a time to make an example.



Examples (specially regarding Python) would be greatly appreciated!

Tinu


1 utenti hanno apprezzato questo post
Davide Carpi 27/05/2016 08:16:00
#11 Pubblicato: 06/08/2016 10:22:58
Ahmet Anil Dindar

Ahmet Anil Dindar

1 apprezzamenti in 2 post.

Gruppo: User

Dear all,
I donwloaded @uni's #3 smath file. Tried to understand but it seems more explanation is needed for low level users like me


It would be really perfect having Python scripts running within Smath.

Is there any ongoing effort?

++Ahmet
1 utenti hanno apprezzato questo post
frapuano 02/03/2017 09:44:00
#12 Pubblicato: 02/03/2017 01:04:24
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Updated. Variable terms added. Some namespaces declared implicit.

2017-03-02_09-01-57.png

Script:

Mostra spoiler

Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
frapuano 02/03/2017 09:44:00
#13 Pubblicato: 02/03/2017 15:51:49
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Updated. Fixed some issues related to vb compiler.
Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
frapuano 02/03/2017 19:32:00
#14 Pubblicato: 04/03/2017 05:58:07
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Updated. Examples added.
Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
frapuano 04/03/2017 17:36:00
#15 Pubblicato: 04/03/2017 12:44:52
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Updated. Now more magic available.

2017-03-04 20-42-28 SMath Studio - [Script. Lambda. Linq.sm].png

Script:

Mostra spoiler

Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
frapuano 04/03/2017 17:38:00
#16 Pubblicato: 06/03/2017 07:12:14
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Updated. Another attempt to fix the problem related with the portable version. Martin, please try again. Now the tmp directory appears in the plugins directory and you need to remove it content manually periodically. Fix this later.
Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
Martin Kraska 06/03/2017 09:18:00
#17 Pubblicato: 06/03/2017 11:09:45
Martin Kraska

Martin Kraska

1.361 apprezzamenti in 2.275 post.

Gruppo: Moderator

Now working with the portable version, thanks. With maxima, we had quite some issues with temp dirs (interference between multiple smath instances or documents...
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#18 Pubblicato: 08/03/2017 04:12:54
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Add definitions from list of strings. To get a textual representation we use [Ctrl+C], [Ctrl+V].

2017-03-08 12-08-37 SMath Studio - [Script. Load definitions.sm ].png

Script:

Mostra spoiler

Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
Davide Carpi 08/03/2017 06:06:00
#19 Pubblicato: 08/03/2017 13:32:48
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

String to matrix (c#).

2017-03-08 21-31-34 SMath Studio - [Script. String to matrix.sm].png

Script:

Mostra spoiler

Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
frapuano 09/03/2017 13:47:00
#20 Pubblicato: 22/03/2017 13:30:36
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

How to add unit.

2018-09-24_21-50-40.png

Script:

Mostra spoiler

Russia ☭ forever, Viacheslav N. Mezentsev
  • Nuovi post
  • Nessun nuovo post