Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hi,
Is it possible to use the CWD variable to reference worksheets? Meaning instead of clicking on the 'Include <<' button and choosing the referenced worksheet file, to write something like: "CWD\Reference.mcdx" in the field next to the Include << button. I'm using Mathcad Prime 6.0.
Thanks in advance.
Solved! Go to Solution.
If all you're trying to do is to include a (reference) worksheet in the same directory as where the (referencing) Mathcad worksheet itself is saved/located, then you can reference a reference worksheet named 'reference.mcdx' by '.\reference.mcdx'.
In (real) Mathcad, when specifying a reference worksheet you can tick an option to use a relative path, which has the same effect. I don't know if Prime has that option, I'm limited to Express.
Of course, if you are changing the CWD variable within your sheet, the above is not an option for you.
Success!
Luc
Hi,
Use
concat(CWD,"Reference.mcdx")
Cheers
Terry
Nice try. Unfortuantely it looks like the include reference function does not accept ascii string. Also I found this other thread, saying that there is no solution for this issue:
https://community.ptc.com/t5/PTC-Mathcad/Insert-gt-Reference-using-a-Variable/m-p/353759
Thanks for clarification, Fred. What I'm trying to do however is to use the CWD variable in order to include another worksheet file. This would imply that I could, in some way or another, use this string variable (file) as a path to the referenced file. Which is not going to work, as you can see:
This method would work for readfile commands, the ones that read in data. I think you're trying to include mathcad calculation files--the ones that are basically "copied" into the open file. And you're right, that has never worked.
If all you're trying to do is to include a (reference) worksheet in the same directory as where the (referencing) Mathcad worksheet itself is saved/located, then you can reference a reference worksheet named 'reference.mcdx' by '.\reference.mcdx'.
In (real) Mathcad, when specifying a reference worksheet you can tick an option to use a relative path, which has the same effect. I don't know if Prime has that option, I'm limited to Express.
Of course, if you are changing the CWD variable within your sheet, the above is not an option for you.
Success!
Luc