# \[RobotStudio SDK\] Creating Faces

**URL:** <https://tech-community.robotics.abb.com/t/robotstudio-sdk-creating-faces/5571>\
**Category:** Developer Tools\
**Created:** [June 21, 2013, 10:31am UTC](https://tech-community.robotics.abb.com/t/robotstudio-sdk-creating-faces/5571 "2013-06-21T10:31:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HM](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@HM](https://tech-community.robotics.abb.com/u/HM)\
**Post date:** [June 21, 2013, 10:31am UTC](https://tech-community.robotics.abb.com/t/robotstudio-sdk-creating-faces/5571/1 "2013-06-21T10:31:34Z")

</div>

Hi,

I´m trying to create a Body using the Body.CreateFromFace(Face face) function. The problem is that the Face class has no constructor, static members to create it are not available neither. So I don´t know how to create a Face to use it as a parameter of the function.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Niklas\_Skoglund](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@Niklas\_Skoglund](https://tech-community.robotics.abb.com/u/Niklas_Skoglund)\
**Post date:** [June 24, 2013, 9:30am UTC](https://tech-community.robotics.abb.com/t/robotstudio-sdk-creating-faces/5571/2 "2013-06-24T09:30:03Z")

</div>

Hi HM,

it is not possible to create a Face directly using the API. RobotStudio has limited modeling functionality, and there are more APIs for traversing a geometry than creating one.

There are APIs that corresponds to the create functions on the Modeling Tab.

For example [CreateSurfaceCircle Method](http://developercenter.robotstudio.com:80/Index.aspx?DevCenter=BlobProxy/devcenter/RobotStudio&OpenDocument&Url=html/7ff81eb9-9c74-30c7-0c64-f854e424c274.htm&OptTitle=CreateSurfaceCircle)

---

<div class="post-metadata">

**Author:** ![John\_Wiberg](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/john_wiberg/32/1485_2.png) [@John\_Wiberg](https://tech-community.robotics.abb.com/u/John_Wiberg)\
**Post date:** [June 24, 2013, 12:13pm UTC](https://tech-community.robotics.abb.com/t/robotstudio-sdk-creating-faces/5571/3 "2013-06-24T12:13:07Z")

</div>

Hi HM,

What is it that you are trying to accomplish?

In RobotStudio the Face object cannot exist on its own, instead it is always “inside” a body. So while you cannot create a face on its own you have lots of ways of generating surfaces (Face) which you can then use.

For example, I want to break up a solid object into its faces. Then I could take each individual face and put them in a seperate body. Like this:

// Check that we have an active station  
Station \_station = Project.ActiveProject as Station;  
if (\_station == null) return;

Project.UndoContext.BeginUndoStep(“TheBoxYouOpenedItWeCame”);  
try  
{

// Create a part to contain the bodies.  
Part p = new Part();  
\_station.GraphicComponents.Add(p);

// Create a solid box.  
Body box = Body.CreateSolidBox(new Matrix4(new Vector3(0, 0, 0), new Vector3()), new Vector3(1, 1, 1));

foreach (Face i in box.Faces)  
{  
p.Bodies.Add(Body.CreateFromFace(i));  
}

}  
catch  
{  
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);  
throw;  
}  
finally  
{  
Project.UndoContext.EndUndoStep();  
}
