Circle plane problem in c#

I write this code to create a circumfrence circle, and if plane dose not input set it to default plane.
but it give me the Invalid circle when input plane is empety.
//---------------------------------------------------------------------
private void RunScript(double circum, Plane pln, object x, ref object A, ref object B, ref object C)
{
double radious = circum / (2 * Math.PI);
if(pln == null || pln == Plane.Unset ){
pln = Plane.WorldZX;
}
var cir = new Circle(pln, radious );
//Outputs--------------------------------------
B =pln;
A = cir;
C = radious ;
}
//----------------------------------------------------------------------

I dont know c# so well, but it looks like you might want: if (!pln.IsValid)

1 Like

Thanks alot,Thats right.

1 Like