I am trying to make a customized toolbar in Femap 11.2.2. So far I can make the toolbar via the Toolbars tab in Tools/Toolbars/Customize/, and add buttons under the second tab (Commands). Now I made a couple of small scripts and saved each under a different name. Upon adding these scripts via the fourth tab (User Commands) I can add buttons for these scripts in the customized toolbar.
There is one thing that I keep asking myself regarding this fourth tab. It says arguments can be passed on and an initial directory can be set, but I cannot seem to figure out how this works and how I can retrieve the information in the Main() routine in my scripts. Does any have any examples/guidelines for me how this works?
Any help would be appreciated!
P.S.: The ultimate goal for me is to use the arguments in a Select Case in a single Main() to start different functions in the same module, hence not needing 5 different .BAS script files for one toolbar with 5 buttons, but just one .BAS file with one Main() and 5 functions. Hope this makes sense...
Solved! Go to Solution.
Unfortunately there is currently no way to make an internal Basic script use the "Arguments" defined for a "User Command". Those arguments are only passed if "Program" references something other than a Basic script or a Program File (something like a .EXE or .BAT).
The good news is in FEMAP v11.3 this will work. If you define "Arguments", they will be passed to Basic scripts. In the script you can access them with the Command$ function. All arguments are accessed as a single string, so if you are attempting to define more than one, you will have to parse the string yourself inside the script.