# Create new Station RobotStudio SDK

**URL:** <https://tech-community.robotics.abb.com/t/create-new-station-robotstudio-sdk/9584>\
**Category:** Developer Tools\
**Created:** [June 21, 2020, 4:56pm UTC](https://tech-community.robotics.abb.com/t/create-new-station-robotstudio-sdk/9584 "2020-06-21T16:56:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vedo](https://avatars.discourse-cdn.com/v4/letter/v/e5b9ba/32.png) [@vedo](https://tech-community.robotics.abb.com/u/vedo)\
**Post date:** [June 21, 2020, 4:56pm UTC](https://tech-community.robotics.abb.com/t/create-new-station-robotstudio-sdk/9584/1 "2020-06-21T16:56:17Z")

</div>

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](http://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();  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![scottdf93](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@scottdf93](https://tech-community.robotics.abb.com/u/scottdf93)\
**Post date:** [October 28, 2020, 3:47pm UTC](https://tech-community.robotics.abb.com/t/create-new-station-robotstudio-sdk/9584/2 "2020-10-28T15:47:31Z")

</div>

station = new Station();  
station.ActiveTask = station.DefaultTask;  
Project.ActiveProject = station;

// Creates new viewer in the station  
GraphicControl gc = new GraphicControl();  
gc.RootObject = station;  
Camera cam = new Camera();  
cam.LookFrom = new Vector3(10, 10, 10);  
gc.Camera = cam;  
gc.ShowFloor = true;  
gc.ShowUCSGrid = true;

---

<div class="post-metadata">

**Author:** ![Aliwe](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@Aliwe](https://tech-community.robotics.abb.com/u/Aliwe)\
**Post date:** [November 29, 2023, 7:47am UTC](https://tech-community.robotics.abb.com/t/create-new-station-robotstudio-sdk/9584/3 "2023-11-29T07:47:35Z")

</div>

while compilation this command: Station station = Station.ActiveStation; makes this error this error : System.TypeInitializationException  
HResult=0x80131534  
Message=The type initializer for ‘ABB.Robotics.RobotStudio.Stations.Station’ threw an exception.

Inner Exception 1:  
ReflectionTypeLoadException: Unable to load one or more of the requested types.  
Could not load file or assembly ‘System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’. The system cannot find the file specified.  
Could not load file or assembly ‘System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’. The system cannot find the file specified.  
This means that the connection with RobotStudio through SDK was not established. What is the solution for that?  
I appreciate any help!

---

<div class="post-metadata">

**Author:** ![sugumar\_venkatesan](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@sugumar\_venkatesan](https://tech-community.robotics.abb.com/u/sugumar_venkatesan)\
**Post date:** [June 13, 2024, 11:07am UTC](https://tech-community.robotics.abb.com/t/create-new-station-robotstudio-sdk/9584/4 "2024-06-13T11:07:47Z")

</div>

Hi,

i am facing the same error right now.  
could you please let me know if you gt any answer for this query.

Thanks!
