cancel
Showing results for 
Search instead for 
Did you mean: 

Independent Code Writing/Macros within PS

Experimenter
Experimenter

Is it possible to write Macros or Code WITHIN the Process Simulate software? 

 

If yes, how (In as much detail as possible)?

If no, alternatives for OLP modifications in house (In as much detail as possible)?

 

Thanks

2 REPLIES

Re: Independent Code Writing/Macros within PS

Siemens Pioneer Siemens Pioneer
Siemens Pioneer

Of course. This is what we refer to as the .net API.

In order to learn how to use it, please have a look at our samples In the "knowledge Bases" section.

For a more detailed course on how to use the .Net API, you may contact us via your reseller.

Re: Independent Code Writing/Macros within PS

Creator
Creator
S1: With C#, you can try load dynamic Assembly at runtime, so you don't need to restart PS,

S2: I once implement vbscript macros for PS through COM, but you need to create C# COM class which expose PS API to vbscript,

Example:
In C#:
...
object com = Microsoft.VisualBasic.Interaction.GetObject("script:" + script.FullName, "");
object result = Microsoft.VisualBasic.Interaction.CallByName(com, "PSMain", Method, parameters);

Vbscript
<?xml version="1.0"?>
<package>
<?component error="true" debug="false"?>
<component>
<public>
<method name="PSMain" />
</public>
&lt;script language="VBScript">
<![CDATA[
Function PSMain(sm, cmd)
MsgBox "Hello PS"
End Function
]]>
&lt;/script&gt;
</component>
</package>