Message 1 of 7
How to enter Robot API through Python

Not applicable
05-12-2018
10:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm looking for (kind of) guidelines/tutorial on how to translate Robot API commands into Python script.
What are main principles, what rules to follow etc.
This forum is rich of API content but there's only few threads about Python. I've read them all and found few information: how to add references or create bars/nodes/labels.
I see its similar e.g.
Dim robapp As New RobotApplication Dim section As RobotLabel Set section = robapp.Project.Structure.Labels.Create(I_LT_BAR_SECTION, "pipe")
in Python equals to:
robapp = RobotApplicationClass() section = robapp.Project.Structure.Labels.Create(IRobotLabelType.I_BAR_SECTION, "VALUE")
but why IRobotLabelType. jumps into brackets?
And how to translate the rest API script:
Dim sectionData As RobotBarSectionData Set sectionData = section.Data sectionData.ShapeType = I_BSST_USER_CIRC_FILLED sectionData.Type = I_BST_NS_TUBE Dim ns As RobotBarSectionNonstdData Set ns = sectionData.CreateNonstd(0) ns.SetValue I_BSNDV_TUBE_D, 0.3 sectionData.CalcNonstdGeometry robapp.Project.Structure.Labels.Store section
Python:
section.Data.ShapeType = I_BSST_USER_CIRC_FILLED section.Data.Type = I_BST_NS_TUBE ns = section.Data.CreateNonstd(0) ns.SetValue(IRobotBarSectionNonstd(0).I_BSNDV_TUBE_D, 0.3) section.Data.CalcNonstdGeometry labels.Store section
?
Python allows me to use Dynamo/Robot cooperability much more effective than "Structural Analysis" package.
So.. what to start with ?
Regards
Marcin