×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Edit trail file to use a current directoy

Edit trail file to use a current directoy

Edit trail file to use a current directoy

(OP)
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

RE: Edit trail file to use a current directoy

(OP)
I am actually doing pretty much exactly what was discussed in thread554-159168: Trail File and Pro/Program woes ,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.

RE: Edit trail file to use a current directoy

(OP)
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.

RE: Edit trail file to use a current directoy

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
www.infotechpr.net

RE: Edit trail file to use a current directoy

(OP)
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.

RE: Edit trail file to use a current directoy

(OP)
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.

RE: Edit trail file to use a current directoy

you should be able to access that directly with proe's vba

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources