Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4120

System.Threading.Tasks.Parallel error in c#

$
0
0

hi everyone
can help to this error when used System.Threading.Tasks.Parallel.For Loop in this code?

using System.IO;
using System.Linq;
using System.Threading.Tasks;
private void RunScript(List<Curve> curve, ref object A)
  {
       System.Threading.Tasks.Parallel.For(0, curve.Count, i =>
    // System.Threading.Tasks.Parallel.ForEach(curve, i =>
      {
      for (int j = curve.Count - 1;j > i; j--){
        var b = Curve.GeometryEquals(curve[i], curve[j]);
        if(b)
          curve.RemoveAt(j);
      }
      });
    A = curve;
  }

System.Threading.Tasks.Parallel.gh (125.3 KB)
@Mahdiyar

7 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 4120

Trending Articles