How to reference the Preference file location
I'm attempting to create a custom toolbar menu that will hold some scripts. All of this will be stored in git, and users will be able to clone their repository anywhere they please.
Therefore, I cannot include any fully-defined paths to .tcl scripts: everything needs to be relative. Is something like this possible?
For example:
*Id("HyperWorks", "20.*") *BeginDefaults() *BeginGraphicDefaults() *BeginMenu(base, Tools) *BeginMenu(results, Post Processing) *MenuItem(results, This Script, TCL, "../my_scripts/this_script.tcl") *EndMenu() *EndMenu() *EndGraphicDefaults() *EndDefaults()
Best Answer
-
Try this method: define your env variable for your TCL path:
TCL_INCLUDE=C:/path1;C:/path2
And within your script use only filename, for example "this_script.tcl"
0
Answers
-
This method should work. Do you test it?
0 -
Yes I have given it a try. It returns:
No such file: ../my_scripts/this_script.tcl
I have also tried it by placing `this_script.tcl` within the same directory as my preferences file and using `./this_script.tcl` and didn't have any luck with that either.
I am surprised it didn't work.
0 -
Try this method: define your env variable for your TCL path:
TCL_INCLUDE=C:/path1;C:/path2
And within your script use only filename, for example "this_script.tcl"
0 -
Thanks Q, that did work. It's unfortunate that the relative path resolving didn't as that's such a common standard...
0