I am working on a cable net structure. I have in my model 529 nodes and 1016 bars. Each bar is a cable element and has a specific cable definition (section and relative dilatation), so I have 1016 different cable sections.
If i use API code to build the RSA model (nodes, elements, sections, supports, prestress load), it is very very long (290 sec. !!). The part which seems to be very long is the cable section definition. It is weird, because if I save the project as a .rtd file, close RSA, and then re-open the .rtd file, the opening is much faster.
I tried to create a temporary .str file to do the same, and then import it and delete the file when importation is completed. For the same result, the calculation time falls to 16 sec, which is 20 times faster ! But still too slow. And I would like to avoid using the str format, as it is not improved anymore, and as syntax is different from API.
So my question is : is there a way to accelerate my code using only API (set RSA not visible for example), or do I have to keep using a .str temporary file ? And how can I speed my code if I work with the .str file ?
Thanks for your help.
Solved! Go to Solution.
have you tried dll?
Do you use cache?
I tried to use cache, as follow :
Dim cache As RobotStructureCache
cache = Robot.Project.Structure.CreateCache()
(...)section definition for Toile1, Toile2, ...
For i = 0 To tabElts.GetLength(0) - 1
cache.SetBarLabel(i + 1, IRobotLabelType.I_LT_BAR_CABLE, "Toile " & i + 1)
No error message, but it does not work. What's wrong ?
OK, that is too bad...
But is my cript correct for another type of bar ?
Example code:Dim robot_cache As RobotStructureCache robot_cache = robot.Project.Structure.createcache For i As int32 = 0 To examplenumber robot_cache.AddNode(nodenum, X, Y, Z) robot_cache.AddNode(nodenum+1, X1, Y1, Z1) robot_cache.AddBar(barnum, nodenum, nodenum + 1, "", "", 0) 'Generate bar in cache robot_cache.SetBarLabel(barnum, IRobotLabelType. I_LT_BAR_SECTION, "HEA100") Next 'Create the Robot objects from the cache robot.Project.Structure.ApplyCache(robot_cache)
And will the .str format be still supported by RSA in the future ?
It is \ will be preserved in the state as is now.
cache for cables corrected for this syntax:
rc.AddBar barnumber, node1, node2, "Cable_1", "STEEL"
in SP4 for Robot 2013