Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hi, I am trying to create a mathcad file with another mathcad file as a reference.
I have test1 file with test2 as a reference using the relative file path. I am trying to pass a=3 from test1 to test2. it works when I first create the variables, however, the variable doesn't update unless I close and reopen the sheets. I already tried the recalculate button.
Is this a bug or is there some problem with the way I am doing it? Thanks
Hallo JP,
To avoid crashes, you must avoid to redefine variables or constants with the same name in the calling file and referrences. If you use variables or constants defined in the reference, they must match, among caller files and references, even the font, color and size. This also applies to functions, the number of parameters or arguments must be the same, not necessarily the parameter names must match.
Best regards
FM
Here is an example of using unit of measure defined in the worksheet "global data.xmcd" and used in th worksheet "electtromagnetics.xmcd":
Second example:
When you reference file "test2" in file "test1," you are effectively inserting test2 at the reference point in test1. Any variable you declared in test2 will be available as an assigned variable in test1. But it doesn't work like a subprogram call--if you define a variable A=3 in test2, then declare A=4 in test1 (above the reference) test2 will still declare A=3. And if you ask for an evaluation below the reference in test1, you will get A=3, even though you declared it differently above.
Referencing works best when you have functions defined and don't want to pack the whole file in again; test1 can call any function in test2 without retyping.
If you change test2 the change will not be evident in test1 until you save and close test2; it may be necessary to close and reopen test1 as well.
James Pyland wrote:
Hi, I am trying to create a mathcad file with another mathcad file as a reference.
I have test1 file with test2 as a reference using the relative file path. I am trying to pass a=3 from test1 to test2. it works when I first create the variables, however, the variable doesn't update unless I close and reopen the sheets. I already tried the recalculate button.
Is this a bug or is there some problem with the way I am doing it? Thanks
Is there any chance you could post the offending worksheets?
It should work, as Fred says, if you don't redefine a inside test2 before you want to use it. Here's a simple example (Mathcad 15):
See if the attached worksheets do what happens above ...
Stuart
If you reference test2 in test1, what is in test2 affects test1, but the reverse is not true. If you open a copy of test2 it is just a standalone worksheet. If you want to pass a=3 from test1 to test2, then test2 must reference test1.