vbacatia

CATIA.StartCommand "Center Graph" Works in English but not in French


So I'm currently working on a macro that will be used in both French in English. I thought the commands are generally universal in VBA, however when I sent my macro out for testing, the following command:

CATIA.StartCommand "Center Graph"

gave an error saying "Command Not Found" or something similar. So I was thinking is there a specific command in each language? How am I supposed to tell which language is being used and use the right command according to that language?

Any thoughts?

I'm currently trying to find a way to extract what is the current language of the environment and use the right command for that language, but there is no way of getting the language directly using one of the APIs. I was also thinking of just using an error handler that will automatically go to the french command, but I'm not quite sure what the french command is.


Solution

  • Start commands are, as you have found out, dependent on the language of the user interface.

    Alternatively, you can use the internal command names, e.g.

    CATIA.StartCommand("CATCafCenterGraphHdr")
    

    These internal names can be found in the CATNls files.

    I recommend avoiding the use of start commands as much as possible