Skip to main content
1-Visitor
December 8, 2017
Question

Connecting to different instances of Mathcad prime 4

  • December 8, 2017
  • 6 replies
  • 4344 views

I am using Mathcad Prime SDK 3.1 for Mathcad Prime 4 to automate some time consuming calculations and worksheet management. As described in SDK, the communication is done over an

ApplicationCreatorClass() call. This works more ore less fine but I cannot control to which running Mathcad instance the link will be performed. My question is: Is there any way to establish connections to different  Mathcad instances running on the same computer?

6 replies

23-Emerald IV
December 8, 2017

Is there any way you can get the process ID number (PID) of the application instance that you are connecting/ connected to?

 

Luc

pklemm-21-VisitorAuthor
1-Visitor
December 10, 2017

Yes. I can get PIDs of all running instances with

System.Diagnostics.Process.GetProcesses().

I tried another way with OLE32.dll:

Reading out the ROT (running object table) with the IMoniker interface, as it is described for EXCEL connection. After getting a running COM object instance the .Net interface or class must be known like here:

if (lComObject is Microsoft.Office.Interop.Excel.Workbook)

{

Microsoft.Office.Interop.Excel.Workbook lExcelWorkbook = (Microsoft.Office.Interop.Excel.Workbook)lComObject;

...

}

I tried to substitude "Microsoft.Office.Interop.Excel.Workbook" with the automation interface class of Mathcad and also with its Application class but there was no match.

 

 

 

 

24-Ruby III
December 20, 2017

Hello,

 

did you already ask PTC Support ? If not, please give them a chance...

pklemm-21-VisitorAuthor
1-Visitor
December 20, 2017

Thank you,

I didnt but I will do now a request.

24-Ruby IV
December 20, 2017

You can use the "Case Logger" tool on PTC's eSupport portal to open technical support case: https://support.ptc.com/apps/case_logger_viewer/auth/ssl/log