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 Kriss  
#1 Posted : 23 January 2017 17:54:20(UTC)
Kriss


Rank: Member

Groups: Registered
Joined: 23/01/2017(UTC)
Posts: 16
Russian Federation
Location: Moscow

Собственно несколько вопросов, как:
1. Написать скрипт
2. Внутри тела скрипта использовать переменные Smath
3. Запускать скрипт по кнопке из exe представления Smath

Код на C# - примерный
Code:

using Kompas6API7;
using System.Runtime.InteropServices;
  
         
 try
            {
                    Kompas6API7.IApplication kompas = (_Application)Marshal.GetActiveObject("KOMPAS.Application.7");
                    IKompasDocument doc =  kompas.App.Documents.Open("test", true, true);
                    IKompasDocument3D doc3D = kompas.App.ActiveDocument as IKompasDocument3D;

                    doc.Close(DocumentCloseOptions.kdDoNotSaveChanges);
                    doc3D.Close()

            }
            catch (Exception)
            {
                kompas = null;


            }
kompas = null;


С уважением!

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

Offline Davide Carpi  
#2 Posted : 24 January 2017 13:46:37(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Hello Kriss Offline ,

It might worth the effort to take a look at the code of existing plugins in our SVN. Some of them:

File import/export/read/save:
- ExcelFileType, XMCDFileType, XlsxImportExport,DataExchange;

Communication between applications:
- XLSXupdate (this is written in VB.NET), Maxima;

Database:
- SQLite;

Edited by user 24 January 2017 14:06:20(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Kriss  
#3 Posted : 24 January 2017 17:51:37(UTC)
Kriss


Rank: Member

Groups: Registered
Joined: 23/01/2017(UTC)
Posts: 16
Russian Federation
Location: Moscow

Hello Davide Carpi Offline

Thanks for the reply.

I'll try workarounds,
if that happen I will try to put.
Offline Kriss  
#4 Posted : 24 January 2017 18:34:47(UTC)
Kriss


Rank: Member

Groups: Registered
Joined: 23/01/2017(UTC)
Posts: 16
Russian Federation
Location: Moscow

Arose fair question.

How to close the Preview window (*.exe file)
after clicking links

explanation
Offline Davide Carpi  
#5 Posted : 25 January 2017 12:44:01(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: Kriss Go to Quoted Post


I guess it is the hyperlink region.

Alignment feature of hyperlinks is not available; I'll take a look on it when possible.

I'm not able to reproduce the 2nd issue, anyone else experienced this?

Edited by user 25 January 2017 12:45:46(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Kriss  
#6 Posted : 25 January 2017 18:02:24(UTC)
Kriss


Rank: Member

Groups: Registered
Joined: 23/01/2017(UTC)
Posts: 16
Russian Federation
Location: Moscow

Hello Davide Carpi

I decided to use Smath Studio (Smath Viewer) as form to enter and calculate data.
The user then presses the Start button (as shown in the picture) and then start my program.
So I would like not to confuse the user and close the data entry form, ie Smath Viewer (executable file *.exe)

With best wishes

Edited by user 25 January 2017 18:06:20(UTC)  | Reason: Not specified

Offline Kriss  
#7 Posted : 25 January 2017 18:19:06(UTC)
Kriss


Rank: Member

Groups: Registered
Joined: 23/01/2017(UTC)
Posts: 16
Russian Federation
Location: Moscow

And another question

since You are a developer Hyperlink Region

It is possible to expand the possibilities of this Extensions:
Add command-line arguments when you start the program

For example:
"CalcMass.exe - ExchangeData.ods"
Offline Davide Carpi  
#8 Posted : 25 January 2017 19:25:13(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: Kriss Go to Quoted Post
Hello Davide Carpi

I decided to use Smath Studio (Smath Viewer) as form to enter and calculate data.
The user then presses the Start button (as shown in the picture) and then start my program.
So I would like not to confuse the user and close the data entry form, ie Smath Viewer (executable file *.exe)

With best wishes

Ah, ok! Good

Sometimes is not possible to close the viewer because internal exceptions, so I've thought about a bug.

I'll check if there is a safe way to kill the application within the hyperlink.
You can always add a text to ask the users that after clicking the link they can safely close the program.

Originally Posted by: Kriss Go to Quoted Post
It is possible to expand the possibilities of this Extensions:
Add command-line arguments when you start the program

For example:
"CalcMass.exe - ExchangeData.ods"


You already can; right click on the region, choose "Flags..." from the context menu, and then add the arguments you need.

2017-01-25 17_25_33-SMath Studio - [Page1_].png

2017-01-25 17_21_08-SMath Studio - [Page1_].png

2017-01-25 17_24_10-SMath Studio - [Page1_].png

Edited by user 25 January 2017 19:58:04(UTC)  | Reason: typo

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Kriss  
#9 Posted : 25 January 2017 19:49:07(UTC)
Kriss


Rank: Member

Groups: Registered
Joined: 23/01/2017(UTC)
Posts: 16
Russian Federation
Location: Moscow

Thank you very much
Really works with the flags
Users browsing this topic
Guest
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.