Hi guys, I`m trying to learn how to use display conduit, and write a script to display a point in view.
import Rhino
import System.Drawing
import scriptcontext
import rhinoscriptsyntax as rs
class PointConduit(Rhino.Display.DisplayConduit):
def __init__(self, pt):
self.pt = pt
print "conduit pt initialized"
def DrawForeground(self, e):
Pointstyle = 0
print "set ps"
radius = 15
print "set radius"
color = System.Drawing.Color.Red
print "set color"
e.Display.DrawPoint(self.pt, Pointstyle, radius, color)
print "draw dot"
def RunCommand():
Point = Rhino.Geometry.Point3d(0,0,0)
print Point
conduit = PointConduit(Point)
conduit.Enabled = True
print "conduit enabled"
scriptcontext.doc.Views.Redraw()
rs.GetString("Pausing for user input")
conduit.Enabled = False
scriptcontext.doc.Views.Redraw()
return Rhino.Commands.Result.Success
if __name__=="__main__":
RunCommand()
This script works as I expected, but I then notice that when I change point style to other styles like 1(represent for ControlPoint),2(ActivePoint) and so on, the script stops display the point in view.
I`d like to ask what reason causes this problem? or is my understanding of point style wrong?