Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

set working directory and read search.pro

HULK

New member
I am working off a network. We have a seperate folders for library components, purchase componentsand jobs. I would like to have a search.pro file in my job folders that references only the folders needed for the main assembly. I don't want a universal search.pro file that has 100's of search paths in it as I think this would slow down Pro.


Is there a way when I set my working directory that I can have Pro read the search.pro file for each job folder?
 
I think I could use a mapkey to set the working directory and load the search.pro. Would that be easy to write?
 
Hi,


Yes it's easy to do. Record a new mapkey:


File - Set Working Directory - paste or type in directory location


Tools - Options - Open config file - located in working directory - Apply, close. The config file can have a link to a searh.pro file or have the search paths in it - I also add path to local start_part/assembly, drawing borders, BoM formats.


Stop mapkey recording .... remember to save the mapkey back to the config file in your start-up directory (not the config file in your working directory)


I usualy record a mapkey for each project I'm working on - and I've added a new pull-out menu (right mouse click on top bar, select commands - mapkeys are near the bottom) which has an icon for each project so I can select it when I start Pro. Once you have added the new menu/icons save the config.win file to your start-up directory.
 
Thanks Allan,


I made a mapkey to set the working directory. I put a pause in the mapkeyso I could load a search.pro file from various job folders. Seems to be working so far.
 
Hello,<?:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" />


at this moment we're having a search.pro file which counts 100's of lines and it slows our ProE (WF3) a lot.
Now I want to split our search.pro-file in separate files in each project:
One general file to put in the library folders (e.g. X:\Install\search.pro)
And for each project (at this moment we have like 1000 projects) a separate search.pro-file, which contains the folders from other projects and/or specific CAD-data of our customers. (e.g. R:\Customer\2009125\ProE\search_project.pro)


I was trying to make a mapkey like described above.
But the problem is: I have to fill in each time the location of the
 
The problem is that you cannot load a search path file directly, what you need to do is load a config file. I can think of a couple of ways to do this, including a user DOS prompt to select a project at launch and then run a mapkey that would set the directory and load the appropriate search path file. That's a bit involved for a forum posting and involves more than just recording mapkeys.

A simpler way might be to save a config.pro file along with your search_project.pro that has a single search_path_file statement pointing to that search_project.pro file. Then, I think you can record a universal mapkey to load that config.pro file, assuming that config.pro file is always named the same. Here's how I'd do it:
  1. Set your working directory tot eh folder where the config.pro file is located, presumably the project working directory. The search_project.pro file need not reside there, but it may make the most sense. As long as the config.pro points to the right place, it doesn't matter.
  2. Start recording a mapkey.
  3. Pick tools -> options.
  4. Click the File Open button.
  5. In the File Open dialog, click the working directory icon. I'd do this even if the working directory was already displayed to get it in the mapkey in case it isn't when it's run.
  6. Select the config.pro file with the search_path_file statement in it and click Open.
  7. Click OK in the options dialog.
I based that sequence on WF2, which is what I have open right now. The sequence might be slightly different on other versions. What you want to avoid is directly entering text, either by the keyboard or by copy-paste. Pro|E doesn't record the paste operation, it records eh exact text.

I think that ought to work, but make sure you test it pretty well.
 
use this:
search_path_file .\search.pro

This is another nice option I just learned about.

file_open_default_folder working_directory

Make sure you have a search.pro for each project.

This is our mapkey. Works great for us. Wildfire 4.0

mapkey 1sw @MAPKEY_NAMESet the working directory and loads the search.pro \
mapkey(continued) file if there is one.;@MAPKEY_LABELSet Working Dir;\
mapkey(continued) ~ Command `ProCmdSessionChangeDir` ;\
mapkey(continued) @MANUAL_PAUSESelect Working Dir\nNo need to hit OK;\
mapkey(continued) ~ Activate `file_open` `Open`;~ Command `ProCmdUtilPref` ;\
mapkey(continued) ~ FocusOut `preferences` `InputOpt`;~ Activate `preferences` `Open`;\
mapkey(continued) ~ Activate `file_open` `Current Dir`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist`1 `search.pro`;\
mapkey(continued) ~ Activate `file_open` `Open`;~ Activate `preferences` `ApplySave`;\
mapkey(continued) ~ FocusOut `preferences` `InputOpt`;~ Activate `preferences` `Close`;\
mapkey(continued) ~ Command `ProCmdModelOpen`;
 
We just use the convention that we change to the working directory and immediately load the config.pro file in that directory. I made a mapkey with an icon & stuck it right between the change working directory & file open icons. The working directory config.pro loads any special search path entries as well as makes any other project specific changes like units, templates, etc.
 
HULK said:
use this:
search_path_file .\search.pro

I think that will only work if Pro|E is launched with the desired working as the 'Start in' folder. I guess it'll also work in a config file loaded after the working directory is set.
 

Sponsor

Articles From 3DCAD World

Back
Top