Robot Python - Structural Units

Robot Python - Structural Units

basava.guru
Explorer Explorer
1,294 Views
4 Replies
Message 1 of 5

Robot Python - Structural Units

basava.guru
Explorer
Explorer

Hi

I want to set units for moment. But I could not set moment unit as kN*m

 

Robotapp = RobotApplicationClass()
Project = Robotapp.Project
Preferences = Project.Preferences
Structure = Project.Structure
Labels = Structure.Labels
Units = Preferences.Units

Project.Open("C:\Temp\\Structure01.rtd") # empty 3d robot model

 

# Set units for force, moment and stresses
RU = Preferences.Units.Get(IRobotUnitType.I_UT_FORCE)
RU.E = False
RU.Name = "kN"
RU.Precision = 2
Preferences.Units.Set(IRobotUnitType.I_UT_FORCE, RU)

RUCD = Preferences.Units.Get(IRobotUnitType.I_UT_MOMENT)
print(RUCD.Name)
print(RUCD.E)xz  
RUCD.Name = "kN"
RUCD.Precision = 2
Preferences.Units.Set(IRobotUnitType.I_UT_MOMENT, RUCD)
RUCD.Name2 = "m"
Preferences.Units.Set(IRobotUnitType.I_UT_MOMENT, RUCD)

0 Likes
Accepted solutions (2)
1,295 Views
4 Replies
Replies (4)
Message 2 of 5

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

hi @basava.guru 

try this

RUCD = RobotUnitComplexData(Preferences.Units.Get(IRobotUnitType.I_UT_MOMENT))
RUCD.E = False
RUCD.Name = "kN"
RUCD.Name2 = "m"
RUCD.Precision = 2
Preferences.Units.Set(IRobotUnitType.I_UT_MOMENT, RobotUnitData(RUCD))

Best regards

 

 

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
EESignature
0 Likes
Message 3 of 5

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

add also

Units.Refresh

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to click the Accept Solution button and leave a < like !
EESignature
0 Likes
Message 4 of 5

basava.guru
Explorer
Explorer

Thank you Stephane

0 Likes
Message 5 of 5

basava.guru
Explorer
Explorer

Hi Stephane,
Any documentation available on Robot(ARSA) API and Python?

0 Likes