RSA API vs .STR : slower or faster ?

RSA API vs .STR : slower or faster ?

Anonymous
Not applicable
1,142 Views
7 Replies
Message 1 of 8

RSA API vs .STR : slower or faster ?

Anonymous
Not applicable

Hi,

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.

0 Likes
Accepted solutions (1)
1,143 Views
7 Replies
Replies (7)
Message 2 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support
0 Likes
Message 3 of 8

Anonymous
Not applicable

Hi,

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)

Next

 

Robot.Project.Structure.ApplyCache(cache)

 

No error message, but it does not work. What's wrong ?

 

 

0 Likes
Message 4 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support

Sorry, unfortunately applying cable lables by cache does not work so far.

 



Rafal Gaweda
0 Likes
Message 5 of 8

Anonymous
Not applicable

OK, that is too bad...

But is my cript correct for another type of bar ?

 

And will the .str format be still supported by RSA in the future ?

0 Likes
Message 6 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

guillaumeniel wrote:

OK, that is too bad...

But is my cript correct for another type of bar ?

 

Seems ok.

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.

 



Rafal Gaweda
0 Likes
Message 7 of 8

Anonymous
Not applicable

OK, Thanks

0 Likes
Message 8 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support

cache for cables corrected for this syntax:

 

rc.AddBar barnumber, node1, node2, "Cable_1", "STEEL"

 

in SP4 for Robot 2013



Rafal Gaweda
0 Likes