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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

reference files not working

jpyland
3-Visitor

reference files not working

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

4 REPLIES 4
-MFra-
21-Topaz II
(To:jpyland)

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":

How to use references.jpg                                                     

Second example:

How to use references example.jpg

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.

StuartBruff
23-Emerald II
(To:jpyland)

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

RichardJ
19-Tanzanite
(To:jpyland)

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.

Top Tags