Mini Task to Simulate a path RobotStudio

Hi,
It’s the first time that I try to create a simulation path to move my robot in 3d robotstudio view.
My first step is to move programmatically the robot tool around in a square path.
Only an easy 3d simulation to move the robot with RS SDK code.
It’s important for me because I have to make an easy 3d simulation as soon as possible.
Are there some tutorial task that show how to do this? Does anyone help me?
Thanks in advance.

I found something about it:
(this example is using a set of RsTarget)

n–>number of the element

RawPath path = new RawPath[n];
RsPathProcedure myPath = new RsPathProcedure(“myPath”);
RsMoveInstruction myMove = new RsMoveInstruction[n];
RsTarget myRsTarget = new RsTarget[n];
RsRobTarget myRobTarget = new RsRobTarget[n];
mystation.ActiveTask.PathProcedures.Add(_myPath);

for(int i = 0; i < n; ++i){
//my function that creates a move where I passed: starting position of the path line, its orientation and an incremental index
myMove[i] = CreateMove(newVector3(1,2,3), new Vector3(0, 180, 0), i);

myPath.Instructions.Add(_myMove[i]);
}

RsMoveInstruction CreateMove(Vector3 position, Vector3 orientationXY, int index) {
RsRobTarget robTarget = new RsRobTarget();
// Set the position and rotation of the
RobTarget. robTarget.Frame.X = position.x;
robTarget.Frame.Y = position.y;
robTarget.Frame.Z = position.z;
robTarget.Frame.RX = ABB.Robotics.Math.Globals.DegToRad(orientationXY.x);
robTarget.Frame.RY = ABB.Robotics.Math.Globals.DegToRad(orientationXY.y);
robTarget.Frame.RZ = ABB.Robotics.Math.Globals.DegToRad(orientationXY.z);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
mystation.ActiveTask.DataDeclarations.Add(robTarget);
// Create an RsTarget for the RobTarget, to give it a graphical representation and use it to get configs.
RsTarget rsTarget = new RsTarget(_station.ActiveTask.ActiveWorkObject, robTarget);
rsTarget.Name = robTarget.Name;
// Add it to the ActiveTask. mystation.ActiveTask.Targets.Add(rsTarget);
myRsTarget[index] = rsTarget;
myRobTarget[index] = robTarget;
return new RsMoveInstruction(
mystation.ActiveTask, “Move”, “Default”,
MotionType.Linear,
mystation.ActiveTask.ActiveWorkObject.Name,
robTarget.Name,
mystation.ActiveTask.ActiveTool.Name);
}

to execute the path call this → myPath.MoveAlong();