RSA API Load on edge(Panels and polylines)

RSA API Load on edge(Panels and polylines)

1234eddie
Advocate Advocate
752 Views
2 Replies
Message 1 of 3

RSA API Load on edge(Panels and polylines)

1234eddie
Advocate
Advocate

Hi all,

 

I wrote a script inside Dynamo to create a "linear load on edge". the script works and aplies the load on the edge.

this is my graph:

Dynamo graph.JPG

this is the result from the scrip in RSA

Script result.JPG

and in the red box in this picture the result when i do it by myself.

Result done by myself.jpg

 

The result in the red box is what i'm trying to achieve with my dynamo script. because i work on projects where i have lots of loads applied to edges, and this will repeat for every single case i have. so when i now have to print a report i end up with many pages with load records. while i prefer to have it all in one list.

 

I hope someone can provide me some insight how to create the list i'm looking for?

 

@Rafal.Gaweda I checked your link, but this is a little bit different.

 

Thanks in advance.

 

Gr Edward.

 

The script works also for load on edges of panels.

All files are attached.

Here is the script Load on edge

 

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
clr.AddReferenceToFileAndPath(user +r"\Dynamo\Dynamo Core\1.3\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
from RobotOM import *
from System import Object

Object = IN[0]
Sup_edge = IN[1]
LoadCaseNumber = IN[2]
LoadPX = IN[3]
LoadPY = IN[4]
LoadPZ = IN[5]


application = RobotApplicationClass()
project = application.Project
structure = project.Structure
labels = structure.Labels
loads = structure.Cases

CreatedLoads = []

for i in range(len(Object)):
	case = structure.Cases.Get(LoadCaseNumber)
	simplecase = IRobotSimpleCase
	simplecase = case
	rec = IRobotLoadRecord
	IRobotLoadRecordMngr = simplecase.Records
	obj = IRobotObjObject
	obj = structure.Objects.Get(Object[i])
		
	Uniform = []
	Uniform.append(simplecase.Records.New(IRobotLoadRecordType.I_LRT_LINEAR_ON_EDGES))
	LoadRecord = simplecase.Records.Get(Uniform[0])
	LoadRecord.SetValue(0,LoadPX)
	LoadRecord.SetValue(1,LoadPY)
	LoadRecord.SetValue(2,LoadPZ)
	LoadRecord.Objects.FromText(Sup_edge[i])
	CreatedLoads.append(LoadRecord.UniqueID)
	obj.Update

OUT = "gedaan"

 

 

Accepted solutions (2)
753 Views
2 Replies
Replies (2)
Message 2 of 3

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Hi @1234eddie 

 

As far as I can see in each loop iteration you create load record and assign edge to it.

And effect You get is correct.

You have to create "only" one load record and add edges by .AddText or make string similar to "1_EDGE(2) 1_EDGE(3)" and use .FromText.

 



Rafal Gaweda
0 Likes
Message 3 of 3

1234eddie
Advocate
Advocate
Accepted solution

Hi all, @Rafal.Gaweda 

 

I got this solved for my case.

I added "string from array" and removed the object input.

 

If anyone know a more clever way of using this function let me know.

 

see the graph below.

Dynamo graph edited.JPG

 

and this is the edited script.

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
clr.AddReferenceToFileAndPath(user +r"\Dynamo\Dynamo Core\1.3\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
from RobotOM import *
from System import Object

Sup_edge = IN[0]
LoadCaseNumber = IN[1]
LoadPX = IN[2]
LoadPY = IN[3]
LoadPZ = IN[4]


application = RobotApplicationClass()
project = application.Project
structure = project.Structure
labels = structure.Labels
loads = structure.Cases

CreatedLoads = []

case = structure.Cases.Get(LoadCaseNumber)
simplecase = IRobotSimpleCase
simplecase = case
rec = IRobotLoadRecord
IRobotLoadRecordMngr = simplecase.Records
	
Uniform = []
Uniform.append(simplecase.Records.New(IRobotLoadRecordType.I_LRT_LINEAR_ON_EDGES))
LoadRecord = simplecase.Records.Get(Uniform[0])
LoadRecord.SetValue(0,LoadPX)
LoadRecord.SetValue(1,LoadPY)
LoadRecord.SetValue(2,LoadPZ)
LoadRecord.Objects.FromText(Sup_edge)
CreatedLoads.append(LoadRecord.UniqueID)

OUT = "gedaan"
0 Likes