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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Using CWD variable to reference worksheet

DaniBoy
5-Regular Member

Using CWD variable to reference worksheet

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.

 

ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:DaniBoy)

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

View solution in original post

6 REPLIES 6

Hi,

Use

 

concat(CWD,"Reference.mcdx")

 

Cheers

Terry

 

DaniBoy
5-Regular Member
(To:terryhendicott)

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

 

FredKohlhepp_0-1575897835832.png

 

DaniBoy
5-Regular Member
(To:Fred_Kohlhepp)

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:

 

CWD.JPG

 

 

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.

LucMeekes
23-Emerald III
(To:DaniBoy)

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

Announcements

Top Tags