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

Mapkey to point to next file in folder?

SamLamb
1-Newbie

Mapkey to point to next file in folder?

Hello Everyone,

I apologize if this has been discussed before but I searched and could not find it. I was wondering, is there a way to get a mapkey to point to the next file in a folder? The reason I need to do this is for a couple things. The first reason is: When I get a large step file assembly, sometimes I have to go through and add each component to the assembly at its default placement. This is very time consuming but I've created a mapkey that will open the file folder, prompt me to pick the next file, open the component, and place it in its default placement. This speeds up the process a little bit but what I really need is for the mapkey to pick the next file for me. I've tried several different ways to do this but the mapkey will not record my actions of selecting the next file. What it does is record the specific file name that I've selected, not the next file in the folder. How can I get the mapkey to automate this process? If I could just get it to know to pick the next file instead of recording file names, I could use this for any step file I encounter. Also, I could use this to automate the process of going through each drawing of a large assembly and creating a dxf and pdf for each drawing. If there is any way to do this, please let me know.

Thanks,

Sam Lamb

Edit: I'm using Pro/E Wildfire 4.0 with datecode M190


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
3 REPLIES 3

For this sort of task I usually create a training file - much like a trail file, a training file is just a series of commands. Unlike a trail file, Creo/Proe won't die if it hits an error.

To start, start a new session, and run just one cycle, including saving and closing the window. Then quit.

Look for the trail file and rename it with a .txa suffix.

Open the file and you'll see where the file name(s) are. Keep the first part, but remove the close window and exit section at the end.

The critical section is from the first action to the last action. The idea is to duplicate this section and, for each file, fill in that section with the appropriate information. Mail merge can be used; VBA in Excel; my favorite - AutoIT. There are also some utilities for batch jobs for Creo/Proe on the web.http://www.usginnotiv.nl/en/31366/uTools.html has SBatch from spekan.

Thanks for the reply David. I'm interested in how I could use this method. I think I could do something with VBA in excel. I've already found a macro that pulls in all the filenames in a folder to a worksheet for me but its been a very long time since I've messed with VBA. I think what I really don't understand is how I could tie in the VBA stuff with Pro/E. What would I do with the .txa file after I created it? I did a little practice run and I can kinda see what you are talking about in the trail file. Can I run macros in it? Is there any way you could explain a little more about how you would do it?

Thanks,

Sam

The .txa file is run as a training file - under Tools I think (I'm away from work.) The .txa execution does not die in the way that trail files do if there is some flaw in the execution.

VBA is used to generate the training file -

Use Print statements and set out the 'outline' material - the file header, and whatever is static, while mixing in the names of the files in the locations originally occupied in the example trail file by file names.

I find it useful to manually create .txa files to cut out the extra junk. I believe lines starting with ~ are not required or the other way around. The lines ending in \ can be concatenated with their following lines. The trail files also include the key-by-key entry of names, only the last of which have importance.

Keep trimming until it doesn't work, then put the last bit back and trim until there is nothing left. That's the main advantage of txa files- Pro/E doesn't crash out.

Dave S.

Announcements