# Error about using RSA API on Dynamo

**URL:** <https://forum.dynamobim.com/t/error-about-using-rsa-api-on-dynamo/96664>\
**Category:** Robot Structural Analysis\
**Tags:** cpython3\
**Created:** [December 25, 2023, 6:13pm UTC](https://forum.dynamobim.com/t/error-about-using-rsa-api-on-dynamo/96664 "2023-12-25T18:13:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ugur\_yavan\_61](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ugur_yavan_61/32/160009_2.png) [@ugur\_yavan\_61](https://forum.dynamobim.com/u/ugur_yavan_61)\
**Post date:** [December 25, 2023, 6:13pm UTC](https://forum.dynamobim.com/t/error-about-using-rsa-api-on-dynamo/96664/1 "2023-12-25T18:13:17Z")

</div>

Hello everyone, I am trying to create simple truss on RSA by using API. I managed to do basically everything except Defining the list of objects to which load will be applied. In this step I am getting error even though I am doing same thing that tutorial document shows. Any idea how can I solve this problem ?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/6/660000a85489e3cb702149ff3bf4f5fbaa7c0ab4.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 25, 2023, 7:51pm UTC](https://forum.dynamobim.com/t/error-about-using-rsa-api-on-dynamo/96664/2 "2023-12-25T19:51:20Z")

</div>

What is the error?

I have found that a zero touch node written in C# is a more effective way of interacting with the Robot API due to the API being written for COM.

---

<div class="post-metadata">

**Author:** ![ugur\_yavan\_61](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ugur_yavan_61/32/160009_2.png) [@ugur\_yavan\_61](https://forum.dynamobim.com/u/ugur_yavan_61)\
**Post date:** [December 26, 2023, 10:33am UTC](https://forum.dynamobim.com/t/error-about-using-rsa-api-on-dynamo/96664/3 "2023-12-26T10:33:17Z")

</div>

I can create a load case and set value to that case as you can see in the picture. But when I try to choose the node which load will be applied, I got error. In documentation it says I should use “case11.Objects.FromText(“1”)” this line for this purpose but I am having trouble in this line.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/4/f42476be40023b5b8241802307c6a725778906d9.png)

Here is the example of my code :

```auto

# Load the RSA API library
clr.AddReference(r'D:\Programs\Autodesk\Revit2024\Robot Structural Analysis Professional 2024\Exe\interop.RobotOM.dll')

# Import the RSA API
from RobotOM import *
from System import Object

RobApp= RobotApplicationClass()
# Initialize the Robot application
RobApp.Project.Structure.Nodes.Create(1,0,0,0)
RobApp.Project.Structure.Nodes.Create(2,10,0,0)
RobApp.Project.Structure.Nodes.Create(3,0,0,10)
RobApp.Project.Structure.Nodes.Create(4,10,0,10)
RobApp.Project.Structure.Nodes.Create(5,20,0,10)
RobApp.Project.Structure.Nodes.Create(6,20,0,0)

RobApp.Project.Structure.Bars.Create(1,1,2)
RobApp.Project.Structure.Bars.Create(2,3,4)
RobApp.Project.Structure.Bars.Create(3,4,5)
RobApp.Project.Structure.Bars.Create(4,2,4)

RobApp.Project.Structure.Bars.Create(5,2,6)
RobApp.Project.Structure.Bars.Create(6,5,6)
RobApp.Project.Structure.Bars.Create(7,1,4)
RobApp.Project.Structure.Bars.Create(8,2,3)
RobApp.Project.Structure.Bars.Create(9,4,6)
RobApp.Project.Structure.Bars.Create(10,2,5)
	
# Retrieve a node and set its label
# with the 'SetLabel' method.
set_node1 = RobApp.Project.Structure.Nodes.Get(1)
set_node2 = RobApp.Project.Structure.Nodes.Get(3)

# Cast the COM object to the specific interface type
support1= IRobotNode(set_node1)
support2= IRobotNode(set_node2)

# Now you can call the 'SetLabel' method
support1.SetLabel(IRobotLabelType.I_LT_SUPPORT, "Fixed")
support2.SetLabel(IRobotLabelType.I_LT_SUPPORT, "Pinned")

# Create a new simple case
case_number = RobApp.Project.Structure.Cases.FreeNumber
cas = RobApp.Project.Structure.Cases.CreateSimple(case_number,"Case_1", IRobotCaseNature.I_CN_PERMANENT , IRobotCaseAnalizeType.I_CAT_STATIC_NONLINEAR)

case1=cas.Records.Create(IRobotLoadRecordType.I_LRT_NODE_FORCE)

case11=RobotLoadRecord(case1)
case11.SetValue(IRobotNodeForceInPointRecordValues.I_NFIPRV_FZ , 3000)

print(dir(case11))

case11.Objects.FromText("1")

```

Result of my print command is :

```auto
 [
  ['GetValue', 'SetValue', ' __class__', ' __delattr__', ' __dir__', ' __doc__', ' __eq__', ' __format__', ' __ge__', ' __getattribute__', ' __gt__', ' __hash__', ' __init__', ' __init_subclass__', ' __iter__', ' __le__', ' __lt__', ' __module__', ' __ne__', ' __new__', ' __reduce__', ' __reduce_ex__', ' __repr__', ' __setattr__', ' __sizeof__', ' __str__', ' __subclasshook__', 'get_Objects', 'get_Type']

]

```

The error I get is :  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/9/c95d9ca93d7939a4cf1e783ba5fe90dbdfdb8ec6.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 26, 2023, 10:51am UTC](https://forum.dynamobim.com/t/error-about-using-rsa-api-on-dynamo/96664/4 "2023-12-26T10:51:17Z")

</div>

Best to ask on the robot product forum for API issues, but my guess is you need to use get\_Objects due to the Python interpretation of the C# api.

Again, Python implementation of COM APIs is very limiting and I recommend using C# and a zero touch node setup instead.

---

<div class="post-metadata">

**Author:** ![1234eddie](https://avatars.discourse-cdn.com/v4/letter/1/4da419/32.png) [@1234eddie](https://forum.dynamobim.com/u/1234eddie)\
**Post date:** [January 4, 2024, 9:17pm UTC](https://forum.dynamobim.com/t/error-about-using-rsa-api-on-dynamo/96664/5 "2024-01-04T21:17:07Z")

</div>

@ugur_yavan_61

You are not the only one with this problem.  
I tried your script and ran into the same problem, see also my topics with my username here and on the RSA forum.

What i think is happening is that if i click in the API documentation to Objects, you and up in the area of selection.  
This is a short part of a script that select nodes, maybe we can go from here?

```auto
	SelectionNodes = structure.Selections.Get(IRobotObjectType.I_OT_NODE)
	SelectionNodes.FromText(str(allnodes[j]))
	structure.Labels.Get(IRobotLabelType.I_LT_SUPPORT,supportlabel2)
	structure.Nodes.SetLabel(SelectionNodes,IRobotLabelType.I_LT_SUPPORT,supportlabel2)

```

Hope you will find this usefull  
Or maybe @JacquesGaudin now how to use the selected nodes to apply the load to.

Gr Edward

---

<div class="post-metadata">

**Author:** ![1234eddie](https://avatars.discourse-cdn.com/v4/letter/1/4da419/32.png) [@1234eddie](https://forum.dynamobim.com/u/1234eddie)\
**Post date:** [January 5, 2024, 7:25am UTC](https://forum.dynamobim.com/t/error-about-using-rsa-api-on-dynamo/96664/7 "2024-01-05T07:25:32Z")

</div>

@JacquesGaudin

thanks for your answer.

> [@JacquesGaudin](#):
>
> I guess Autodesk have compiled their own binaries for Pythonnet but something must have happened in the process.

@gwizdzm @jacob.small can you share us insight in this if it’s goiing to be solved from the autodesk side or structural analysis package part.  
I would really like to know?

other information in [this topic](https://forum.dynamobim.com/t/apply-loads-to-cases-rsa-2024/92681/23)  
the suggested option does not work.

Hope to hear from the team soon

Gr Edward

---

<div class="post-metadata">

**Author:** ![1234eddie](https://avatars.discourse-cdn.com/v4/letter/1/4da419/32.png) [@1234eddie](https://forum.dynamobim.com/u/1234eddie)\
**Post date:** [January 5, 2024, 7:27am UTC](https://forum.dynamobim.com/t/error-about-using-rsa-api-on-dynamo/96664/8 "2024-01-05T07:27:39Z")

</div>

@ugur_yavan_61  
can you share the tutorial where you are talking about?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [January 5, 2024, 9:23am UTC](https://forum.dynamobim.com/t/error-about-using-rsa-api-on-dynamo/96664/9 "2024-01-05T09:23:42Z")

</div>

> [@JacquesGaudin](#):
>
> I guess Autodesk have compiled their own binaries for Pythonnet but something must have happened in the process.

99.9% sure Dynamo does not have its own own Python - feel free to compare the checksum of the included binaries in [GitHub](https://github.com/DynamoDS/Dynamo/tree/34877080e63862d083ef93183e1736d4d28afbbe) to those of the Python foundation releases.

I am not sure what Jacques saw that indicated otherwise to him.
