I have the exact same problem. Did you find a solution?
I have tried using:
import time
time.sleep(seconds)
but, without successâŚ
I wonder if the problem is that objects hasnât been created yet in Robot even though the information for creating them has been sentâŚ
My code:
#####################################################################
# Enable Python support and load DesignScript library
import clr
clr.AddReference(âProtoGeometryâ)
from Autodesk.DesignScript.Geometry import *
# add Robot Structural Analysis API reference
from System import Environment
#get the current user folder i.e C:\Users\<you>\AppData\Roaming
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
# add the reference to the interop file shipped with the package
clr.AddReferenceToFileAndPath(user +r"\Dynamo\Dynamo Core\2.0\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
#add needed import to be able to use Robot Structural Analysis objects
from RobotOM import *
from System import Object
# The inputs to this node will be stored as a list in the IN variables.
name = IN[0]
kX = IN[1]
kY = IN[1]
# Place your code below this line
# Connect to the running instance of Robot Structural Analysis
application = RobotApplicationClass()
# Get a reference of the current project
project = application.Project
# Get a reference of the current model
structure = project.Structure
# Get a reference of the label server
labels = structure.Labels
# create a new label of type thickness with the name passed as parameter
out = labels.Create(IRobotLabelType.I_LT_SUPPORT, name)
out.Data.ElasticSurface=True;
out.Data.KX=kX
out.Data.KY=kY
out.Data.UX=0
out.Data.UY=0
out.Data.UZ=0
labels.Store(out)
# Assign your output to the OUT variable.
OUT = out.Name
#####################################################################
My error message:
#####################################################################
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File ââ, line 34, in
EnvironmentError: System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at Microsoft.Scripting.ComInterop.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message)
at CallSite.Target(Closure , CallSite , Object , Object , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Microsoft.Scripting.Interpreter.DynamicInstruction4.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at Microsoft.Scripting.Interpreter.DynamicInstruction
5.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
at DSIronPython.IronPythonEvaluator.EvaluateIronPythonScript(String code, IList bindingNames, IList bindingValues)
#####################################################################