Certain Code Causing C# Add-in To Not Load
joman
✭
I am writing an add-in to Robotstudio using Visual Studio and C# in order to test the camera view manipulation possibilities. I have made several add-ins before in Visual Basic without problems, but now in C# I seem to be having problems getting RobotStudio to recognize/load the Add-in. While I have more code in my add-in the following is sufficient for me to cause the problem:
The add-in created with the following code is found by Robotstudio without any problems:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ABB.Robotics.Math;
using ABB.Robotics.RobotStudio;
using ABB.Robotics.RobotStudio.Environment;
using ABB.Robotics.RobotStudio.Stations;
using ABB.Robotics.RobotStudio.Stations.Forms;
namespace StereoTest
{
public class Stereoscopic
{
public static void AddinMain()
{
Project.UndoContext.BeginUndoStep("CameraProperties");try{// Create a new tab.RibbonTab ribbonTab = new RibbonTab("Stereo", "Stereo");UIEnvironment.RibbonTabs.Add(ribbonTab);}catch{Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);throw;}finally{Project.UndoContext.EndUndoStep();}
}
}
}
However, If I mention the class "Camera" at all, the add-in fails to be recognized by RobotStudio and is not loaded nor is it found under the "general" folder in add-ins. For example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ABB.Robotics.Math;
using ABB.Robotics.RobotStudio;
using ABB.Robotics.RobotStudio.Environment;
using ABB.Robotics.RobotStudio.Stations;
using ABB.Robotics.RobotStudio.Stations.Forms;
namespace StereoTest
{
public class Stereoscopic
{
public static void AddinMain()
{
Project.UndoContext.BeginUndoStep("CameraProperties");try{Camera myCam = new Camera();// Create a new tab.RibbonTab ribbonTab = new RibbonTab("Stereo", "Stereo");UIEnvironment.RibbonTabs.Add(ribbonTab);}catch{Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);throw;}finally{Project.UndoContext.EndUndoStep();}
}
}
}
In the actual application I have the camera code in an event handler for a button being pushed but this seems to be irrelavent for the problem. I've also noticed that not only does references to the "Camera" class cause the problem but also references to the "Station" class.
Any ideas as to what could be causing this?
0
Comments
-
I have also noticed that this problem occurs when referencing to any class that is in ABB.Robotics.RobotStudio.Stations.0
-
Hi,is the auto-activate addin option enabled? If so, when you open RS it tries to activate the addin and, since you don´t have any station active, it fails to load station objects (ie the camera). I had some problems with this in the past.0
-
Hi,Just thought I might post the answer here if anyone else has this problem later. The problem was simply that my license had expired and it seemed that this restricted certain add-ins from being able to load. After installing a fresh license the add-in was found and executed without any problems.Hope this helps someone later!HM said:Hi,is the auto-activate addin option enabled? If so, when you open RS it tries to activate the addin and, since you don´t have any station active, it fails to load station objects (ie the camera). I had some problems with this in the past.The option was enabled, but I made sure that no code that would auto-run (addinMain code) attempted to access the station.0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings