Cancel
Showing results for 
Search instead for 
Did you mean: 

API macros in customized toolbar

Experimenter
Experimenter

Dear all,

 

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!

 

Best wishes,

Cor

 

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

2 REPLIES

Re: API macros in customized toolbar

Siemens Phenom Siemens Phenom
Siemens Phenom

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.

Re: API macros in customized toolbar

Experimenter
Experimenter

Thanks a bunch! I was getting crazy trying to find how this works :-P Looking forward to upgrading to v11.3!