How to use the graphics API to draw objects (for example a line)?
One can use the following code :
graphics = ExtAPI.Graphics p1 = graphics.CreateWorldPoint(point1.X, point1.Y, point1.Z) p2 = graphics.CreateWorldPoint(point2.X, point2.Y, point2.Z) line = graphics.Scene.Factory3D.CreatePolyline([p1,p2])
You can add some info to make the line visible:
line.LineWeight = 4 line.Color = 0x00FFFF
Just to complete :
draw_cmd = ExtAPI.Graphics p1 = draw_cmd.CreateWorldPoint(0,0,0) p2 = draw_cmd.CreateWorldPoint(1000,0,0) graphics = ExtAPI.Graphics line = graphics.Scene.Factory3D.CreatePolyline([p1,p2]) line.LineWeight = 4 line.Color = 0x00FFFF
Hello,
I've tried to used this code to draw a line with both points not in the origing. Script is executed but nothing happens.
I've also tried to create the line and move the coordinate after. But line is created and than it disappears.
Any idea how to draw a line between two points where position can be defined?
Can you please my previous posts and leave only the first one? I had some issues with the website. Sorry for the spam!