cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

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

sm�ller-2
11-Garnet

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

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 5
LucMeekes
23-Emerald III
(To:sm�ller-2)

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

Hey,

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

LucMeekes
23-Emerald III
(To:sm�ller-2)

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).

RichardJ
19-Tanzanite
(To:LucMeekes)

you cannot write a Mathcad function to do that for you.

You can't write something in Mathcad to create the assignment, but it is possible to use a script to change it. That doesn't solve the problem though, because the value will not change until the script exits, so it will take on the last value in the loop. It could be done by calling Mathcad via the automation interface from a standalone vbscript, which could also save multiple copies of the Mathcad file. I don't see the point though. All the cases can be documented in a single Mathcad file, so why create hundreds of files (it sounds like the sort of thing a government agency would do!)?

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.

Top Tags