Rigid Links and Logical Lists in API

Rigid Links and Logical Lists in API

Romanich
Mentor Mentor
580 Views
1 Reply
Message 1 of 2

Rigid Links and Logical Lists in API

Romanich
Mentor
Mentor

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

LinkedIn | Robot & Хобот | App Store for Robot
EESignature


0 Likes
Accepted solutions (1)
581 Views
1 Reply
Reply (1)
Message 2 of 2

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Of course it is like that.
All text keywords (in case of selections "to", "by") depends on selected language
See this macro with my way of dealing with some keywords
http://forums.autodesk.com/t5/robot-structural-analysis/api-macro-for-highlighting-nodes-with-instab...

example:

 

lang = Robapp.Preferences.GetLanguage(I_L_WORK)

    detected = Switch(lang = 1, "detected at node", lang = 44, "detected at node", lang = 48, "w węźle", lang = 33, "au noeud", lang = 34, "en el nudo")

 



Rafal Gaweda
0 Likes