get UCS coordinates
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.5K RobotStudio
- 396 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)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings