[RobotStudio SDK] Creating Faces
Comments
-
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 [URL=http://developercenter.robotstudio.com:80/Index.aspx?DevCenter=BlobProxy/devcenter/RobotStudio&OpenDocument&Url=html/7ff81eb9-9c74-30c7-0c64-f854e424c274.htm&OptTitle=CreateSurfaceCircle Method ]CreateSurfaceCircle Method [/URL]
0 -
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();
}John
Developer Center0
Categories
- All Categories
- 5.5K RobotStudio
- 395 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)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings