Skip to main content
3-Newcomer
December 14, 2024
Solved

Running MathCAD Prime 8 Calculations

  • December 14, 2024
  • 2 replies
  • 1560 views

I have 15 executable MathCad Prime 8 calculations that I’d like to run from a Windows Command batch file. How do I do this?

Best answer by terryhendicott

Hi,

Using the command line just opens the worksheet.

 

I suggest using the PTC Prime API as you can open, close, calculate, and exchange data into and out of Prime.  See help for examples.

Capture.JPG

2 replies

23-Emerald V
December 14, 2024

@LP_12590548 wrote:

I have 15 executable MathCad Prime 8 calculations that I’d like to run from a Windows Command batch file. How do I do this?


What does you mean by “executable” Mathcad Prime 8 calculations?  For example, do you mean that you have 15 worksheets that you like to run from a batch file? Or do you mean something else’s?

 

Putting aside your question for a while, what is your particular reason for wanting to run Mathcad calculations from a Windows batch file? What does this do for you that running the calculations within Mathcad does not?

 

Stuart

23-Emerald V
December 14, 2024

If you wish to pursue the batch file route, you can create a batch file of the form.

 

 

"MathadPath\MathcadPrime.exe" "Worksheet Path\File 1.mcdx"
"MathadPath\MathcadPrime.exe" "Worksheet Path\File 2.mcdx"
...
"MathadPath\MathcadPrime.exe" "Worksheet Path\File 15.mcdx"

 

 

In my setup, MathadPath is C:\Program Files\PTC\Mathcad Prime 10.0.1.0.

 

I've tested the method using a couple of worksheets.

 

Stuart

21-Topaz II
December 15, 2024

Hi,

Using the command line just opens the worksheet.

 

I suggest using the PTC Prime API as you can open, close, calculate, and exchange data into and out of Prime.  See help for examples.

Capture.JPG

23-Emerald V
December 15, 2024

@terryhendicott wrote:

Hi,

Using the command line just opens the worksheet.

 

I suggest using the PTC Prime API as you can open, close, calculate, and exchange data into and out of Prime.  See help for examples.

Capture.JPG


True.  I had forgotten that worksheets don't recalculate even if the Auto-Calculate option is selected.

 

It's a shame that the OP has Mathcad Prime 8 and not Mathcad Prime 10, otherwise the OP might have been able to write a Mathcad worksheet that used an Advanced Control to access the API to open and calculate a "batch" of other Mathcad worksheets.

 

Stuart