Creating add-in using Visual Studio
Comments
-
For example, if I would like to test the Logger-example in the API documentation - is this what the complete Visual Studio C#-code should look like?:
__________________________________________________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 Addin1
{
public class Class1
{public static void AddinMain()
{
Project.UndoContext.BeginUndoStep("Logger");
try
{
// How to add categories to the Logger!
// Add two categories.
Logger.CategoryCaptions.Add("MyKey", "My Category");
Logger.CategoryCaptions.Add("AnotherKey", "Another Category");// Print a message in different categories.
Logger.AddMessage(new LogMessage("This is just a test
message!", "MyKey"));
Logger.AddMessage(new LogMessage("This is just a test
message!", "AnotherKey"));
}
catch (Exception e)
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw e;
}
finally
{
Project.UndoContext.EndUndoStep();
}}
}
}__________________________________________________0 -
When i Debug the program above I get the following message from Visual Studio:
"A project with an Output Type of Class Library cannot be started directly...."Should this be the case?EDIT:I found the following:danwa2009-05-03 15:56:14
http://msdn.microsoft.com/en-us/library/68c8335t(VS.80).aspx
This states that Start external program is not available in Visual Studio Express. Is this function necessary to be able to build applications for RobotStudio?0 -
Hello danwa,
I found this which explains how to debug a DLL in Visual Studio Express. In short, your MyProjectName.csproj.user should look something like this:
[code]<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<StartAction>Program</StartAction>
<StartProgram>C:Program FilesABB Industrial ITRobotics ITRobotStudio 5.12BinRobotStudio.exe</StartProgram>
</PropertyGroup>
</Project>
[/code]
Your code looks correct. Note that the UndoContext statements aren't strictly necessary in this case since you only call logger methods. Only methods that somehow modify the station data are undoable.
regards,
Johannes
Johannes Weiman
Software Engineer
ABB Robotics0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings