Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Edit trail file to use a current directoy 1

Status
Not open for further replies.

aafuni

Mechanical
Dec 29, 2009
188
0
0
US
I have created an Excel file with some data entry fields and a button. Clicking the button opens Pro/E with a trial file which imports the data and makes changes to the part based on the Excel file. Basically it is a graphic calculator that runs an analysis on the part based on the Excel values.

My problem is that I need to pass this on to other people. Currently it works fine in the directory I was originally using when I created the trail file. If I move the file or rename the folder, the trail file no longer points to a valid location. I need a way to go back and edit the file to have it use the current directory so anyone can run it no matter what computer they are on.

Thanks to anyone who can help
 
Replies continue below

Recommended for you

I am actually doing pretty much exactly what was discussed in thread554-159168 ,however I don't know how to edit the trail to change the directory path to work on other computers.

The only reference to a path name is in the trail file as follows:

#READ FILE
!%CPEnter file name [Quit]
!%TR
C:\path\data.txt

(I shortened the path name down to \path\ for this post)

Other places it says `Current Dir` rather than listing a path. I need a way to get C:\path\data.txt to become something like `Current Dir` & \data.txt.
 
Yeah I have wf4, I have the directory in my vba script in excel, but I need to replace a line in my trail file with the current directory. I guess I could have vba open the trail file and rewrite the line with the current directory, but that seems like a lot of work.

I noticed in the trail file already there are lines saying 'Current Dir' so I figured there must be a way to use this right in the file.
 
I have done a project where I used a excel file to modify a trail file prior to it being run in pro/e. In addition to other changes for what I was doing, I changed the current directory with vba code in excel. This is one way to do what you want. As you are opening pro/e from excel, you might have pro/e open in the directory you want.

Peter Stockhausen
Senior Design Analyst (Checker)
Infotech Aerospace Services
 
I am having trouble in excel getting it to replace a specific line of text. Any one have any pointers on how to do this? Excel is already opening Pro/E in the proper directory and loading the proper trail file, but my trail file has a line referencing a directory. I want the trail file to be general to where ever I am running the excel file from.

The ways to do this would be:
Substitute a 'Current Dir' type line into the trail file, which I am not sure is possible and if it is I dont know the syntax
or
Have excel open the trail file and replace the line with the current directory path of the trail file (ActiveWorkbook.Path & '\trail.txt'). I cant figure out how to do this either though. I have found several examples using FileSystemObject, which isnt working for me.

I have vb 6.5 and WF 4.0 M090.
 
I got it figured out...

I have excel import my trail file as a sheet in the excel file. It then goes to the cell where the file path is and changes the value to the active path. It then exports this file back out and saves it.

Thanks for the pointers.
 
Status
Not open for further replies.
Back
Top