Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have found some awkward bug (or it is a feature?) in the Robot API. If Robot GUI has working language different from English (for example Russian), the code will not work as it should:
Dim RNRLS As RobotNodeRigidLinkServer Set RNRLS = RobApp.Project.Structure.Nodes.RigidLinks RNRLS.Set 1, “2to8”, "RLink"
Only one rigid link will be created – to node 2, because logical lists in Robot are localized (I thought they should not depend from language through API).
To solve this issue we can try to do like this:
Dim Robapp As New RobotApplication Dim CurrLang As Long CurrLang = Robapp.Preferences.GetLanguage(I_L_WORK)’get current language of Robot Robapp.Kernel.Preferences.SetLanguage I_L_WORK, 1 ’switch to English (code 1) Dim RNRLS As RobotNodeRigidLinkServer Set RNRLS = RobApp.Project.Structure.Nodes.RigidLinks RNRLS.Set 1, “2to8”, "RLink" Robapp.Kernel.Preferences.SetLanguage I_L_WORK, CurrLang ’switch back to original language
And everything is awesome!
Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.
Roman Zhelezniak
Robot Evangelist & Passionate Civil Structural Engineer
Solved! Go to Solution.