Robot API + Dynamo undefined warning

Robot API + Dynamo undefined warning

milczarekuba
Participant Participant
628 Views
4 Replies
Message 1 of 5

Robot API + Dynamo undefined warning

milczarekuba
Participant
Participant

 

Hello

I got a problem with using Robot API in Dynamo. I am trying to set bars as a trussbars, but when I running graph for a first time I am getting warning like below, when I add for example new line in any place in python script and run graph for a second time it works. I have no idea what is going on, I'd be greatful for some help.

 

@Rafal.Gaweda You helped my couple of times, I hope you will solve my problem also this time.

Thanks for any help.

 

 

 

milczarekuba_1-1604352973061.png

milczarekuba_2-1604353572947.png

 

 

Ostrzeżenie:IronPythonEvaluator.EvaluateIronPythonScript operacja nie powiodła się.
Traceback (most recent call last):
File "<string>", line 28, in <module>
EnvironmentError: System.Runtime.InteropServices.COMException (0x80004005): W wyniku wywołania składnika modelu COM został zwrócony błąd HRESULT E_FAIL.
w Microsoft.Scripting.ComInterop.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message)
w CallSite.Target(Closure , CallSite , Object , Object )
w System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
w Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
w Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
w Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
w System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
w Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
w Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
w Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
w IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
w Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
w DSIronPython.IronPythonEvaluator.EvaluateIronPythonScript(String code, IList bindingNames, IList bindingValues)

0 Likes
629 Views
4 Replies
Replies (4)
Message 2 of 5

1234eddie
Advocate
Advocate

@milczarekuba 

are you using the bar functions from the structural analysis package?

 

what i found in my scripts is that the python nodes are way quicker than the build in nodes of the package. 

(that's why i create my scripts full python.)

 

but what you can try is to use: application.Project.ViewMngr.Refresh()  on line 19 before you get the bars.

or use waitfor,passtrhough nodes.

@131863 

@Rafal.Gaweda (correct me if i'm wrong)

 

Gr Edward

 

0 Likes
Message 3 of 5

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @1234eddie 

 

It might be like that.

Hint : I remember, once I discovered that user script (located  let say in the middle on graph) was executed at the beginning , not waiting for any input data. The solution was either to write "half" of Dynamo routine (everything before script + user script) as one script or make user node from this user script.

   



Rafal Gaweda
0 Likes
Message 4 of 5

milczarekuba
Participant
Participant

milczarekuba_0-1604422977983.png

milczarekuba_1-1604423362222.png

 

It do not work ;( I tried also time.sleep() as well. No idea what is going on

@Rafal.Gaweda 

Now  I discovered that when I put this node after calcualations it works perfect, but I need to set TrussBars before Calculations. Do You have any ideas to deal with it? I do not want calcualate project two times because this script is part of Optimo optimizing script and I calculate about 30k versions of my structure, so time is very important for me.

 

 @1234eddie I tried to generate whole structure by API but I got few basic problems, now I only write some functions in python when Structural Analaysis for Dynamo do not have nodes that I need. If You can share some basics scripts I'd be greatful.

0 Likes
Message 5 of 5

1234eddie
Advocate
Advocate

@milczarekuba 

Check out the topic's I have created over the last year's. And also on the dynamo forum(same username).

Most of them will have the dynamo as attachment.

If you have other questions let me know.

 

Gr edward