get UCS coordinates
Options
Hi,
I am developing an application (as an Add-In) with the following aim:
I have a CAD model imported in the workstation.
And then I click on a random point in that CAD model.
Based on the orientation of the CAD model, I want to draw a vector (Arrow) pointing perpendicular to the surface (lets not worry about which of the two directions that arrow is pointing).
How do I program this in C#. I mean, in robotstudio, I can see that whenever we click on the graphic view, there is a UCS coordinate information.
And there is a draw arrow sort of class in PC-SDK.
any feedback wil be appreciated.
Thanks.
0
Comments
-
Hi
Sorry for late reply.Please find below some code that you might find useful. It's not a ready solution but perhaps a step in the right direction...An arrow will be drawn from the pick point on the box to WObj0 see image.public static void AddinMain()
{
GraphicPicker.GraphicPick += new GraphicPickEventHandler(GraphicPicker_GraphicPick);
}static void GraphicPicker_GraphicPick(object sender, GraphicPickEventArgs e)
{
Part p = e.PickedObject as Part;
if (p == null) return;
DrawMarker(p, e.PickedPosition);
}static void DrawMarker(Part p, Vector3 pos)
{
Station s = Project.ActiveProject as Station;
TemporaryGraphic g = s.TemporaryGraphics.DrawArrow(new Vector3(0, 0, 0), pos, 1 / 100, 1 / 1000, Color.Blue);
}
Lennart H0
Categories
- All Categories
- 5.4K RobotStudio
- 381 UpFeed
- 14 Tutorials
- 12 RobotApps
- 291 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 247 ScreenMaker
- 2.7K Robot Controller
- 280 IRC5
- 46 OmniCore
- 6 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 738 RAPID Programming
- 16 Wizard Easy Programming
- 105 Collaborative Robots
- 3 Job listings