privatevoidRunScript(Point3d PlanePt, int Count, int Radius, List ObsCrv, refobject Points, refobject C, refobject A) { List pts = new List(); Circle cir = new Circle(PlanePt, Radius); Curve CirCrv = cir.ToNurbsCurve(); Point3d[] CirPts; double[] CirPts_double = CirCrv.DivideByCount(Count, true, out CirPts); List result_net = new List(); for(int k = 0; k < Count; k++){ Line ln = new Line(PlanePt, CirPts[k]); List ln_Pts = new List(); for(int i = 0; i < ObsCrv.Count; i++){ Line[] segs = ObsCrv[i].GetSegments(); for(int j = 0; j < segs.Length; j++){ double a; double b; Intersection.LineLine(ln, segs[j], out a, out b, 0.00000001, true); if(Intersection.LineLine(ln, segs[j], out a, out b, 0.00000001, true)){ ln_Pts.Add(segs[j].PointAt(b)); } } } Point3d closest_pt; if(ln_Pts.Count > 0) closest_pt = Point3dList.ClosestPointInList(ln_Pts, PlanePt); else{ closest_pt = CirPts[k]; } result_net.Add(closest_pt); } A = result_net; C = CirPts; }