Create new Station RobotStudio SDK

vedovedo germany
Hi,
I want to create with visual Studio a new Station in RobotStudo. So the problem is, it function to create a new one, but if it opens the new Station there is no graphic window where I can see my Graphic Components like a Box or something else and I don't know how to put a new view in my Station. 
Can someone Help me? I am at beginning to learn RobotStudio SDK


My Code is this 
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using ABB.Robotics.Math;
using ABB.Robotics.RobotStudio;
using ABB.Robotics.RobotStudio.Environment;
using ABB.Robotics.RobotStudio.Stations;
using RobotStudio.API.Internal;
using ABB.Robotics.RobotStudio.Stations.Forms;
using System.IO;
using System.Drawing;
using System.Threading;
namespace LokalenUrsprungVeraendern
{

    public class Class1
    {

        private static void AddinMain()
        {
           
          
            Project.UndoContext.BeginUndoStep("CameraProperties");
            try
            {
                // Set the active project as our station.
                Station station = Station.ActiveStation;
                // If there is no active project...
                if (station == null)
                {
                    // ...create a new one.
                    station = new Station();
                    station.ActiveTask = station.DefaultTask;
                    Project.ActiveProject = station;
                 
                }

                // Create a Camera.
                Camera myCam = new Camera();
                // Set the camera to look at a specific point.
                myCam.LookAt = new Vector3(0, 0, 0);
                // Set the camera to view from a specific point.
                myCam.LookFrom = new Vector3(10, 10, 10);
                // Fix the camera to this point.
                myCam.LockRotate = 0.0;
                myCam.LockTranslate = 0.0;
                myCam.LockZoom = 0.0;
                // Add it to the stations camera collection.
                station.Cameras.Add(myCam);
                // Sync the current view to the camera view.
                GraphicControl.ActiveGraphicControl.SyncCamera(myCam, true, 0);
                // Use the camera as the true camera.
                // This make sure that the constraints on the movement kicks in.
                GraphicControl.ActiveGraphicControl.Camera = myCam;
            }
            catch
            {
                Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
                throw;
            }
            finally
            {
                Project.UndoContext.EndUndoStep();
            }
        }
    }
}


Sign In or Register to comment.