RobotStudio event

RS 5.14.02 API - Part constructor failed



Hi everybody,
 
I'm currently integrating an IronPython 2.7.1 console into RobotStudion 5.14.02 as an Addin. The first tests look very promising and it works so far, but during testing I stumbled over a null reference exception when calling the default constructor of a Part object after creating a new station.
 
System:
Windows 7 Ultimate N 64Bit
Assembly ABB.Robotics.RobotStudio.Stations, Version=5.14.4529.2039
 
I reproduced the same error in the C# part of my Addin by using this Code-Snippet:
 
Station station = Project.ActiveProject as Station;
if (station == null)
    station = new Station();
    station.ActiveTask = station.DefaultTask;
    Project.ActiveProject = station;
}
Matrix4 box_origin = new Matrix4(Vector3.XVector, 0.0);
box_origin.Translate(0.5, 0, 0);
Vector3 box_size = new Vector3(0.1, 0.1, 0.1);
Part childPart = new Part();
..raises Exception:
 
System.NullReferenceException wurde nicht von Benutzercode behandelt.
  Message=Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
  Source=ABB.Robotics.RobotStudio.Stations
  StackTrace:
       bei RobotStudio.API.Internal.PartDef..ctor(Boolean supportGeometry, Boolean createGfx)
       bei RobotStudio.API.Internal.AssemblyModeler.CreateEmptyPart(Part part, Boolean supportGeometry, Boolean createGfx)
       bei ABB.Robotics.RobotStudio.Stations.Part..ctor(Boolean supportGeometry, Boolean createGfx)
       bei ABB.Robotics.RobotStudio.Stations.Part..ctor()
       bei RobotStudioAddin.AddinMainClass.OnTest(Object sender, EventArgs e) in C:UsersRolf SeegerDocumentsRobotStudioAddInsRobotStudioAddinAddinMainClass.cs:Zeile 104.
       bei Sheldon.Scripting.IronPython.IronPythonScriptingContext.DoTest() in C:UsersRolf SeegerDocumentsRobotStudioAddInsSheldonSheldonScriptingIronPythonIronPythonScriptingContext.cs:Zeile 45.
       bei Microsoft.Scripting.Interpreter.ActionCallInstruction`1.Run(InterpretedFrame frame)
       bei Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
  InnerException:
 
I figured out that the station object's TemporaryGraphics property has a null reference when running this Code-Snippet ?!
 
This is not the case when I  open/create a station first and run the code aftwerwards.
 
What's going on here? Any workarounds?
 
Any help is very much appreciated..Thanks, in advance

Comments



  • Hi Rolf,
     
    I found that this post was still without answer.
    Have you been able to make progress with the IronPhyton integration or are you stuck?

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog


  • Hi Niklas,
     
    thank's for your interest of my progress of IronPython integration.
    The probblem I had with the Part constructor isn't solved, yet. But it's not so important for me, anyway. I'd rather wanted to check whether there is any interest in the community about my IronPython integration which runs fine, so far.
     
    A few things are still missing:
    - Syntax highlighting
    - Code completion
     
    I translated and modified a few C# examples of the API into IronPython without any problems. In comparison to VSTA it can access the whole API without the need of the Proxy interface and therefore missing features.
     
    It's a good prototyping environment!
     
    By the way, a couple of years ago I implemented a full functioning Lexer/Parser for the Rapid Language which builds an AST which I'm using to mirror/transform Rapid programs and to check the Syntax, offline (used at BMW plant in Regensburg/Germany for about 300 robots - and more to come..). The UI looks like a simple Editor with mirror/transform functionality on the data (num,pos,orient,pose,robtarget,loaddata,tooldata,wobjdata) and/or AST.
    Inline transformations like recalculation of the robtarget for tool/wobj changes (whether stationary or mounted or mixed scenarios) are done in the source code directly - and this about one year before ABB came out with a similar feature, implemented in RobotStudio.
     
    Currently I'm working on a full featured Editor with douzends of productivity features which can also be controlled from/by IronPython.
     
    If there is anyone out there interested in my efforts, he could contact me. My eMail address will be offered to anyone, I think, is valuable for the project, if he/she leaves a note here.
     
    Don't be upset - I'm doing all this in my spare time, while I'm working full time as a freelancer for a Munich' automation company
     
    Best regards
     
    Rolf