Hi Steve
In Rhino WIP when i use the below python script Rhino crash every time.
In V5 it’s Ok.
import rhinoscriptsyntax as rs
import Rhino
import System
def clipplaneYZ():
pt_start=rs.coerce3dpoint((0,0,0))
line_color = System.Drawing.Color.FromArgb(255,250,0)
cp_color=System.Drawing.Color.FromArgb(255,0,250)
vect1=rs.coerce3dpoint((0,30,0),(0,0,0))# punto o vettore va bene lo stesso
vect2=rs.VectorCreate((0,30,30),(0,0,0))
vect3=rs.VectorCreate((0,0,30),(0,0,0))
def GetPointDynamicDrawFunc( sender, args ):
#***Disegna il quadrato che rappresenta il Clipping Plane
args.Display.DrawLine( args.CurrentPoint,args.CurrentPoint+vect1, cp_color,2)
args.Display.DrawLine( args.CurrentPoint+vect1,args.CurrentPoint+vect2, cp_color,2)
args.Display.DrawLine( args.CurrentPoint+vect3,args.CurrentPoint, cp_color,2)
args.Display.DrawLine( args.CurrentPoint+vect3,args.CurrentPoint+vect2, cp_color,2)
args.Display(args.CurrentPoint)
gp = Rhino.Input.Custom.GetPoint()#creo oggetto gp
gp.SetCommandPrompt("Punto dove mettere il ClippingPlane")
gp.DynamicDraw += GetPointDynamicDrawFunc # chiamo in continuazione la funzione che mi mostra la linea dinamica
gp.Get() # qui ottengo i dati quando clicco
if( gp.CommandResult() == Rhino.Commands.Result.Success ):
pt = gp.Point() # qui ho le coordinate del punto del mouse
WYZP=rs.WorldYZPlane() #piano per clipping plane
WYZP.Origin=pt #origine del clipping plane
cp=rs.AddClippingPlane(WYZP,30,30)
clipplaneYZ()
Ciao Vittorio