Skip to main content
15-Moonstone
October 11, 2012
Question

Programing to support an external program

  • October 11, 2012
  • 1 reply
  • 4013 views

I have been using MathCAD for about 20 years but never the developer’s programing feature. Recently your company purchase a program the will interface with Python, MatLAB, and C++. The program is Orcaflex and is a FEA program. I have started teaching myself Python seems to be the easiest to learn. The Orcaflex program seems to have a class of variables that can be passed to other programs. My understanding is Python cannot be used for scripting in MathCAD. Orcaflex does have an API to allow for linking and a C++ library that can be used. This is a vague question, but I am looking for guidance on the next step. Some of the options are:

Write a C program that calls a MathCAD worksheet.

Write a Vbasic script to transfer the variables.

I am sure there other options, but guidance for the next step is what I am looking for.

Thanks in advance for the support.

1 reply

19-Tanzanite
October 11, 2012

It's not clear to me want you want to do. Control Mathcad from Orcaflex, control Orcaflex from Mathcad, or control both from a third piece of software (e.g. a Python program).

tietjee15-MoonstoneAuthor
15-Moonstone
October 11, 2012

I think it can be done either way, control Orcaflex from MathCAD or pass data to MathCAD from Orcaflex, analyze, and return to Orcaflex. The starting point, I think, would be to pass the data to MathCAD, then back to Orcaflex. Python either control Orcaflex or be called by Orcaflex. Too much flexibilty for me at this time. Just trying to narrow down what may be a good starting point.

19-Tanzanite
October 11, 2012

The starting point is to decide which piece of software is in the driving seat. Based on a very brief look (so I could be wrong!) at the Orcaflex API and scripting documentation, Orcaflex is not set up to call another piece of software. It is called from Python. So you could either call both Orcflex and Mathcad (using the Mathcad API) from Python, or you could write a VBscipt that calls a Python script that calls Orcaflex (kind of a kludge, but it would work), or you could write a User DLL for Mathcad in C++ that calls the Orcaflex API directly.

As an aside, if you are learning Python, download and read "A Byte of Python". It's free, and a good place to start.