Author Topic: Multiple Extend  (Read 368 times)

0 Members and 1 Guest are viewing this topic.

daboho

  • Mosquito
  • Posts: 2
Multiple Extend
« on: August 13, 2020, 03:32:17 PM »
I has make code multiple extend how to handle if Einvalid input i want extend if distance from curve1 to curve2 only if <=0.80
Code: [Select]
[CommandMethod("ext")]
public void  ext1()
{
 var doc = acAp.Document.Manager.MdiActiveDocument();
var db = doc.database;
var ed = ed.editor;
var ss = ed.getSelection();
If(ss.status!=prompt.status.OK) return;
var psr = ss.value
var points = new point3dCollection();
Using(var tr= db.transactionManager.StartTransaction())
{
For(i =0;i < ss.Count;i++)
  {
   var cr1 =tr.getObject(ss[i].ObjectId,OpenMode.ForWrite) as Curve;
   for(j=0;ss.count,j++)
    {
     var cr2=tr.getObject(ss[j].ObjectId,OpenMode.ForWrite) as Curve;
     If(cr1.Objectid == cr2.Objectid) continue;
     If(points.count == 0) continue;
     Points.Clear();
     cr1.IntersectWith(cr2,Intersect.ExtendBoth,points0,0);
     var po = points[0];
    If(po.GetDistanceto(cr2.StartPoint)||po.GetdistanceTo(cr2.EndPoint)>0.80) continue;
     bool fd = po.getdistanceTo(cr1.StartPoint)<po.getdistanceTo(cr1.endpoint);
    cr1.Extend(fd,po);


    }
}


tr.commit();
}
}