Dynamo - Python Output - Matching output of Structural analysis node

python
dynamo
scripting

#1

Hi all
I’m attempting to extend the structural analysis package (Structural analysis for Dynamo) which interacts with Robot Structural Analysis by adding references to e.g. trapezoidal loads, in order to do so I need to mimic the output from the build-in nodes. I’m currently testing with simple analytical nodes (see picture red right) and the original build in node from Autodesk (see picture red left).
The issue is that the output to the left is in the form of a connected “string” and my output is in the form of a list which will cause issues down the road when information is to be submitted to the analysis.calculate node.

I can through my Python script create the desired nodes, bars, loadcases and loads but I cannot return the correct information to back to Dynamo. Hope there are some genius out there willing to chip in.


#2

What’s the goal here?
Do you need do generate a single string like that on the left or aye you trying to split the string on the left to look like the one on the right?
Or do you need to parse both strings and extract values like “x”?


#3

They are not just strings, but DynamoSimulation.RSA.AnalyticalModel.AnalyticalBar objects. To create an object like that you need to use the methods in DynamoSimulationRSA.dll. To be useful downstreams they need to be of the correct object types.

I don’t know if it can be done or not…


#4

Hi Einar
I’m aware of that, but I did wonder. I am creating RSA analytical model objects by connecting to the RSA API through Python and creating a bar using:
RobotApplicationClass().Project.Structure.Bars.Create(AnalyticalBarD1,AnalyticalNodeID1,AnalyticalNodeID2)


#5

The goal was to have the output match the AnalyticalModel object type to be usable downstream as Einar specifies.


#6

Hi Jonathan

Just to be sure… is the output going to be a string type or a RSA type?

I think you could try using a Csharp script. Csharp require variables to be set as specific types, which python doesnt need.

Feel free to drop by, so we can play with it :slight_smile:


#7

Try to use DynamoSimulation.RSA.AnalyticalModel.AnalyticalBar ByAnalyticalNodes(DynamoSimulation.RSA.AnalyticalModel.AnalyticalNode startNode, DynamoSimulation.RSA.AnalyticalModel.AnalyticalNode endNode) in stead from DynamoSimulationRSA.dll


#8

The desired output is RSA type.

The reason for the desired output is the specifications of load-types not available in the build in nodes. It is indeed possible to create these loads through Python though the RSA type object need to be passed to “Analysis.Calculate” node in order to perform calculations using the applied loads.

I’ll drop by and if a solution is found post it in this thread.


#9

I that case I would give Csharp a try…

The requirement to set the type for everything is a disadvantage that comes with Csharp when coming from the Python world, but also an advantage since you always knows what you are passing around :slight_smile: