cancel
Showing results for 
Search instead for 
Did you mean: 

Loading PS study from a local drive programmatically

Creator
Creator

I am trying to load PS study programmatically. It looks like it needs to be done using TxCommandsManager ExcecuteCommand. I am not sure if it is possible. If it is, what is command name and what command parameters should be used?

 

 

9 REPLIES

Re: Loading PS study from a local drive programmatically

Siemens Legend Siemens Legend
Siemens Legend

Is that Process Simulate Standalone or Process Simulate on eMServer?

Re: Loading PS study from a local drive programmatically

Creator
Creator

Right now we need it for PS standalone. We are also evaluating if we need similar functionality for EM-Server or Teamcenter connected PS. 

Re: Loading PS study from a local drive programmatically

Siemens Legend Siemens Legend
Siemens Legend

Hi,

 

Currently for Process Simulate Disconnected there is no API available, but you can run using the Command Line arguments:

tune.exe /c NewAssembler /l offline /file <your_file_with_path>.psz

You can use a batch file to run it. It will load the psz in Standard Mode.

 

For Process Simulate on eMServer there is API - ITxEmsGlobalServicesProvider (LoadStudy and LoadLineSimulationStudy methods).

ITxPlatformGlobalServicesProvider provider = TxApplication.ActiveDocument.PlatformGlobalServicesProvider;

Re: Loading PS study from a local drive programmatically

Creator
Creator

Thank you. It is unfortunate that there is no API for loading study, now we need to reload PS every time we need to load a new study. Any plans to add the API? I am sure it exists, but has not been made public.

 

Re: Loading PS study from a local drive programmatically

Siemens Pioneer Siemens Pioneer
Siemens Pioneer

Hi

Though there is no API for loading a study, there is an option to load PS with a study via the command line. e.g. to start Process Simulate Disconnected with a study called myStudy.psz (located in C:\studies):

1) open command prompt

2) cd to the installation folder, \empower

3) run the following command:

   tune.exe /c NewAssembler /l offline /file C:\studies\myStudy.psz

 

Therefore, as a work around, you can start a new process of Process Simulate disconnected with the required study.

 

Re: Loading PS study from a local drive programmatically

Creator
Creator

27-07-_2016_09-28-31.jpg

Can I change the sysroot via the Batch File?

 

 

Re: Loading PS study from a local drive programmatically

Siemens Pioneer Siemens Pioneer
Siemens Pioneer

Hi

 no there is none, but again, I can think of a work around Smiley Happy.

I don't know if you are familiar with the symbolic link concept, but you can read all about it here and here.

so the idea is as follow-

1) create a symbolic link (e.g. named systemRootSysLink) that points to some system root.

2) in PS set the system root to point to your symbolic link.

 

In order to start Process Simulate with a study (e.g. named myStudy.psz , located in C:\studies), that uses a specific system root (e.g. c:\sysA),  your batch file should do the following:

 

1) set the symbolic link (e.g. systemRootSysLink) to point to the study's system root (e.g. c:\sysA)

2) cd to the installation folder, \empower

3) run the following command:

   tune.exe /c NewAssembler /l offline /file C:\studies\myStudy.psz

Re: Loading PS study from a local drive programmatically

Creator
Creator

Thanks for the workaround. But from what version I can use.
With version 11.1 only Process Simulate is started but the PSZ not loaded.

Re: Loading PS study from a local drive programmatically

Siemens Legend Siemens Legend
Siemens Legend

Load psz from the Command Line is available starting from V12