try
{
ClashOptions opt = ClashOptions.Create();
opt.IncludeTouches = true;
//opt.Clearance = 10.0;
opt.IncludeConnections = true;
opt.TouchGap = 10;
ObstructionList obst = ObstructionList.Create();
ClashSet cs = ClashSet.Create();
DbElement[] obstmems = new DbElement[100];
int i = 0;
foreach (DbElement ele1 in collection)
{
obstmems
= ele1;
i++;
}
Array.Resize(ref obstmems, i);
obst.AddObstructions(obstmems);
bool bResult = CLASHER.Instance.Check(mems, opt, obst, cs);
if (bResult)
{
// inspect clashes
Clash[] aClashes = cs.Clashes;
if (aClashes.Length > 0)
{
ret = true;
}
}
if (ret == true)
break;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}