Skip to main content
1-Visitor
February 10, 2016
Question

Saving the Mathcad File after every step i with the inserted value for i

  • February 10, 2016
  • 5 replies
  • 2334 views

Hey,

with nice help in the community i finally made the Loop to calculate LOadcases and exporting to excel.

Now i would an automatical saving process after every step i.

For further documentation purposes i need a mathcad file for every step i.

In the saved Mathcad File all values should appear for the actual load case.

Example:

In the saved Mathcad File i need

but with the inserted i.....

Result of Load Case 1 as value (i=1):

nexto the Result Vector i need the "OK NOK" condition weather is true or not

Hopefully there is anybody which can help me.

5 replies

23-Emerald IV
February 10, 2016

I think what you want is not possible.

You have a list of values. For each value in the list you perform some calculations. Now you want as many mathcad files as you have list values and each mathcad file should be calculated with another value of the list.

The nature of mathcad files does not allow this. Mathcad does not have a scripting facility that allows to put mathcad syntax onto its sheet.

MsWord e.g. does have a scripting facility (VBA) that allows to change text inside a MsWord document, and VBA even may have a command to save the document.

If it is at all possible with mathcad, it would by by creating the mathcad files from outside of mathcad.

Success!
Luc

1-Visitor
February 13, 2016

Hey,

what do you mean by creating the mathcad file outside of mathcad?! Im confused.

23-Emerald IV
February 14, 2016

The syntax you normally use within Mathcad doesn't allow you to write a sheet that enters e.g. assignments onto a mathcad sheet. That is, you cannot create a Mathcad file that enters e.g.:

anywhere onto the Mathcad sheet. This can only be done using user input; you cannot write a Mathcad function to do that for you.

But Mathcad's .xmcd files are xml structured. If you (manage to get to) know enough of the way Mathcad uses the xml structure, you - might - be able to create the files you need, using an editor that can handle .xml files.

The SetValue method that Mark refers to is generally used to preset a value from within another application, then calculate the sheet and finally you can then use GetValue to get any results. It can be used with e.g. web-pages to use Mathcad as a calculating machine only (you put values in, get results out, but the formulae aren't shown).

1-Visitor
February 10, 2016

If you're familiar with VB programming, take a look at the Mathcad Developer's Reference under the "Help" menu.  I don't think I've ever played with the "SetValue" method, so I don't know if it will do exactly what you want, but I think it should at least get you close.