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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Using variables inside Config.pro paths

BuddyHudson
12-Amethyst

Using variables inside Config.pro paths

To all Pro/E WF4.0 and Creo5 gurus,

Is there a way to use variables inside the paths in a config.pro file?

Example: system_colors_file c:\pro\Garland\%USERNAME%\sf\syscol.scl

This does not work. Saved the syscol.scl from inside Pro/E to have old school background. Restarted Pro/E, no beuno.

Weird thing is though, the one for trail file location works:

trail_dir c:\pro\Garland\%USERNAME%\sf

go figure

If anyone has any insight on this I would appreciate it. I just want the users to be able to store things like system colors in default user location that is specific to only them.

Thanks!


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.
ACCEPTED SOLUTION

Accepted Solutions

Hi Buddy...

We're definitely chasing our tails in this thread. Let me set the record straight and put this issue to bed...

First, the correct nomenclature is $USERNAME or $SYSTEM_VARIABLE where "SYSTEM VARIABLE" can be any valid DOS variable. Second, this variable works for absolutely everything...

... except for the system_colors_file option!

:Tap Tap Tap: Are you listening PTC? (That's me tapping on the screen to get their attention) You cannot use a system variable with the system_colors_file option, it simply does not work. It doesn't even work if you put the variable (or the entire path) in quotations. I've tried all manner of quotations, backquotes, and tick marks. Trust me, it's broken! Works everywhere else... doesn't work here.

So then, you're stuck with Plan B. I don't know how committed you are to making this work- but I have a solution if you're willing to work for it. First, download the attached file called load_colors.txt. This is just a small trail file that executes a few simple commands to load the color file "syscol.scl" from the user's working directory.

People tend to forget about trail files. No one uses them. They're practically useless anymore. Once upon a time they were lifesavers. Now they're just huge streams of text and cluttered, unintelligible hieroglyphics that would make a seasoned archaeologist faint. Still, they can be useful.

The second thing people tend to forget, is that it is possible to run a trail file automatically when you launch Pro/E (or Creo). All you have to do is put the path to the trail file right after the launch command! If you want a pretty detailed explanation of how this is done, see this other THREAD where I went into great detail.

So then, here's the steps to solve the problem:

  • Place the file load_colors.txt somewhere on the user's workstation (maybe someplace protected or hidden away like the Pro/E loadpoint so they're not tempted to monkey around with it).
  • Alter the Pro/E or Creo startup command to run the trailfile. Most people launch Pro/E from the proe.exe command. Many times this command is linked to an icon on their desktop. You can edit the "target" field of your shortcut to run the trailfile. Details below...
  • Place a file called syscol.scl in the user's starting directory or have them change their colors to the scheme they like the best and then save those color choices to syscol.scl in their starting directory.

Details to edit the Pro/E launch command:

  • If you start Pro/E from a shortcut/icon on your desktop, edit the properties of that shortcut. Look at the "target" field. You'll likely see a directory and pathname including proe.exe somewhere at the end. Simply add a space after proe.exe and add the full pathname to the load_colors.txt trail file. This is very important... put the pathname in quotations. For example:

<some path here>\proe.exe "c:\documents and settings\username\working_dir\load_colors.txt"

Notice, your path can be anything you need it to be... just make sure it's enclosed in double quotes as shown above. You don't have to have them but if your pathname contains any spaces, you'll need them. Just be safe and use them.

Other things to note... the trail file (load_colors.txt) specifically attempts to load a file called syscol.scl. Why that name? It's the default name Pro/E will attempt to use when you save a color scheme. You can certainly use another name for your color file, you'll just have to add that name to the load_colors.txt file.

Also, the trail file attempts to load the syscol.scl file from the user's working directory. Why that specific directory? When you start Pro/E, everyone has a startup/working directory. Even if you're using Windchill linked to a local workspace, you still have a working directory. If you don't know what you're working directory is, look in the shortcut you use to launch Pro/E. The "Start In" field defines your working directory. Or... select the "Working Directory" option from the left side of the dialog box that comes up when you attempt to load ANY file. Even in large companies with crazy custom launchers for Pro/E, there's an initial working directory. This should circumvent the problem with the $USERNAME variable.

Once you launch Pro/ENGINEER with the modified shortcut or startup command, the trail file will run and your colors will be set.There's a dozen other cool things you can do with this technique. In this case, you're using the trail file to cleverly work around an obstacle that, hopefully, will be fixed in a future version of Creo.

I could go on for another hour covering all the exceptions and nuances of this process but I think you get the idea. If not, write back.

Good luck!!

-Brian

View solution in original post

9 REPLIES 9

Buddy,

try system_colors_file c:\pro\Garland\$USERNAME\sf\syscol.scl

Martin Hanak


Martin Hanák

Hey Martin,

Tried it but did not work.

Buddy

I think Martin is correct I use:

browser_favorite X:\ProE\ProE_Data\$USERNAME

This works for me in both Wildfire 5.0 and now in Creo 2.0.

Hi Buddy...

We're definitely chasing our tails in this thread. Let me set the record straight and put this issue to bed...

First, the correct nomenclature is $USERNAME or $SYSTEM_VARIABLE where "SYSTEM VARIABLE" can be any valid DOS variable. Second, this variable works for absolutely everything...

... except for the system_colors_file option!

:Tap Tap Tap: Are you listening PTC? (That's me tapping on the screen to get their attention) You cannot use a system variable with the system_colors_file option, it simply does not work. It doesn't even work if you put the variable (or the entire path) in quotations. I've tried all manner of quotations, backquotes, and tick marks. Trust me, it's broken! Works everywhere else... doesn't work here.

So then, you're stuck with Plan B. I don't know how committed you are to making this work- but I have a solution if you're willing to work for it. First, download the attached file called load_colors.txt. This is just a small trail file that executes a few simple commands to load the color file "syscol.scl" from the user's working directory.

People tend to forget about trail files. No one uses them. They're practically useless anymore. Once upon a time they were lifesavers. Now they're just huge streams of text and cluttered, unintelligible hieroglyphics that would make a seasoned archaeologist faint. Still, they can be useful.

The second thing people tend to forget, is that it is possible to run a trail file automatically when you launch Pro/E (or Creo). All you have to do is put the path to the trail file right after the launch command! If you want a pretty detailed explanation of how this is done, see this other THREAD where I went into great detail.

So then, here's the steps to solve the problem:

  • Place the file load_colors.txt somewhere on the user's workstation (maybe someplace protected or hidden away like the Pro/E loadpoint so they're not tempted to monkey around with it).
  • Alter the Pro/E or Creo startup command to run the trailfile. Most people launch Pro/E from the proe.exe command. Many times this command is linked to an icon on their desktop. You can edit the "target" field of your shortcut to run the trailfile. Details below...
  • Place a file called syscol.scl in the user's starting directory or have them change their colors to the scheme they like the best and then save those color choices to syscol.scl in their starting directory.

Details to edit the Pro/E launch command:

  • If you start Pro/E from a shortcut/icon on your desktop, edit the properties of that shortcut. Look at the "target" field. You'll likely see a directory and pathname including proe.exe somewhere at the end. Simply add a space after proe.exe and add the full pathname to the load_colors.txt trail file. This is very important... put the pathname in quotations. For example:

<some path here>\proe.exe "c:\documents and settings\username\working_dir\load_colors.txt"

Notice, your path can be anything you need it to be... just make sure it's enclosed in double quotes as shown above. You don't have to have them but if your pathname contains any spaces, you'll need them. Just be safe and use them.

Other things to note... the trail file (load_colors.txt) specifically attempts to load a file called syscol.scl. Why that name? It's the default name Pro/E will attempt to use when you save a color scheme. You can certainly use another name for your color file, you'll just have to add that name to the load_colors.txt file.

Also, the trail file attempts to load the syscol.scl file from the user's working directory. Why that specific directory? When you start Pro/E, everyone has a startup/working directory. Even if you're using Windchill linked to a local workspace, you still have a working directory. If you don't know what you're working directory is, look in the shortcut you use to launch Pro/E. The "Start In" field defines your working directory. Or... select the "Working Directory" option from the left side of the dialog box that comes up when you attempt to load ANY file. Even in large companies with crazy custom launchers for Pro/E, there's an initial working directory. This should circumvent the problem with the $USERNAME variable.

Once you launch Pro/ENGINEER with the modified shortcut or startup command, the trail file will run and your colors will be set.There's a dozen other cool things you can do with this technique. In this case, you're using the trail file to cleverly work around an obstacle that, hopefully, will be fixed in a future version of Creo.

I could go on for another hour covering all the exceptions and nuances of this process but I think you get the idea. If not, write back.

Good luck!!

-Brian

Used this info and it worked like a charm..thanks Brian.

jwagh
17-Peridot
(To:BrianMartin)

@BrianMartin ,

FYI - I was able to use a system variable with the system_colors_file option.

Thanks so much Brian!

You're very welcome! I just wish I had more time so I could make videos of these complicated answers. I know it's tough to decipher a page and a half of text instructions.

Good luck... if you get stuck write back.

Take care...

-Brian

This is how I fixed my problem. Its way wasier than what Brian has suggested.

  1. Save a syscol.scl file somewhere you think it would be safe from tampering. I saved mine in my documents.
  2. Then open a config file from "C:\Program Files\PTC\Creo Elements\Pro5.0\text" into a notepad or word file. Your path could be different but config file for CREO most likely would reside in \text.
  3. Then add this line in the config file that you opened in word, "system_colors_file /whereever you saved syscol.scl in step 1"
  4. Save the config file.
  5. Start ProE (CREO) and then goto TOOLS->OPTIONS and you will see the line you added there with the name "system_colors_file"
  6. Click on the above name on system_colors_file in the options window and then go to the bottom where it says value and right underneath, there is borwse. THIS IS THE KEY.
  7. Click on browse and point to where you saved your syscol.scl file in step one and walla it works after you apply. NEXT TIME YOU OPEN PRO E it will be your color scheme that you saved in syscol.scl

HOPE THIS HELPED!

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags