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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to modify automatically the path of an inserted file

PatriceBujard
1-Visitor

How to modify automatically the path of an inserted file

Dear Mathcad specialists, I am working with Mathcad since Mathcad 1.0 but I am not really well skilled and I know only the mathcad features which I need for my numerical modelisations.

I have some basic files which I inserted in larger programs. I make the insertions through the conventional available command button and everything works well.

Recently I had to transfer my files on a new computer and for internal reasons, the name of the main hard disk has been changed from D to C. The consequence is that all my insertions were wrong since the pathes were obviously not correct any more. It is time consuming and not alwaqys very easy to correct all insertions and insertions within insertions etc..

I would like to avoid such an issue in the future and I am ready to modfiy the main program such that the insertion get the right path automatically.

Does anyone knows if we can create a mathcad macro which generates automatilly the right path for the inserted files ?

May be that's obvious but I have no idea since I am almost never writing mathcad macros.

Thank's for you help

ACCEPTED SOLUTION

Accepted Solutions

I'm afraid if you have not selected the relative path option as Vladimir has suggested you will have to manually go through all the reference files and change the path.

How many references do you have?

Mike

View solution in original post

6 REPLIES 6

Patrice, hello!

When you insert links to other documents did you use relative path for them (option "Use relative path for reference")?

There are many ways this can be achieved. Can you provide an example of the file path which needs changing?

Mike

Thank you for the proposal and sorry for the long delay for my answer.

I join 2 files "Main for insertion example PB.xmcd"

"Subroutine for insertion example.xmcd"

Which are very simple examples how I am making file insertion. The subroutine is inserted in the main and with the correct folder name it works perfectly.

All my files are structurized like in this simple example and I have many sub sub routine inserted in one another.

My issue is that with the arrival of a new hardware the name of the main disk has changes (C: instead of D:) and I need to redo all the insertion by hand.

I am reayd to rework all my insertion if I know how to have insertion which can be modified automatically. For example a change of disk 😧 by a disk C: would be a simple parameter modification in the main file.

I have tried relative path but it seems not to work. May I don't know how to use it.

I hope that I am clear enough.

Best regards and Thank you for your help

P Bujard

I'm afraid if you have not selected the relative path option as Vladimir has suggested you will have to manually go through all the reference files and change the path.

How many references do you have?

Mike

You need to use a relative path to the Mathcad file: "Use relative path for reference" (in this case, the files must be in one folder). This option can be activated on the tab "Properties" -> "Preference" for the necessary links. See attachment to the message as it appears in Mathcad.

Pic_1.jpg

Nice explanation Vladimir.

Mike

Announcements

Top Tags