Message 1 of 23
Apply loads to load cases, RSA 2024
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I am trying to use RSA 2024 with the extention Dynamo to run the following script. My objective is to get the bars loaded with the input values as the first figure on the left shows. However the python script gives me an error.
The error is "PythonEvaluator.Evaluate operation failed/ IndentationError : ('Expected an indented block',('<string>',37,5,' Uniform = []\n'))". occurs when running the script.
The Python script is also attached.
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
sys.path.append(user+r"\Dynamo\Dynamo Core\2.11\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
clr.AddReference('interop.RobotOM')
#clr.AddReference(user+r"\Dynamo\Dynamo Core\2.11\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
from RobotOM import *
from System import Object
objects = IN[0]
LoadCaseID = IN[1]
ILRT = 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 = []
case = structure.Cases.Get(LoadCaseID)
simplecase = IRobotSimpleCase(case)
rec = IRobotLoadRecordMngr(simplecase.Records)
count = rec.Count
for i in range(count+1)[::-1]:
rec.Delete(i)
for j in range(len(objects)):
for k in range(len(objects[j])):
Uniform = []
Uniform.append(rec.New(ILRT))
LoadRecord = IRobotLoadRecordLinear3D(rec.Get(Uniform[0]))
LoadRecord.SetValue(0,LoadPX)
LoadRecord.SetValue(1,LoadPY)
LoadRecord.SetValue(2,LoadPZ[j])
LoadRecord.Objects.FromText(' '.join(str(objects[j]) for el in objects))
CreatedLoads.append(LoadRecord.UniqueID)
#LoadRecord.Objects.FromText(str(objects[j][k]))
application.Visible = True
application.Interactive = True
application.Project.ViewMngr.Refresh()
OUT = objects
Could you help me to solve this issue?
Thank you beforehand for your help.
Best regards,
Stefany Salguero