var doc = Application.DocumentManager.MdiActiveDocument;
var ed = doc.Editor;
var db = doc.Database;
var ppo = new PromptPointOptions("\nSelect point: ") { AllowNone = false };
var pt1 = ed.GetPoint(ppo).Value;
var pt2 = ed.GetPoint(ppo).Value;
var psr = ed.SelectCrossingWindow(pt1, pt2);
var vl = new Line(pt1, pt2);
var oic = new ObjectIdCollection();
if (psr.Status != PromptStatus.OK)
return;
using (var dl = doc.LockDocument())
using (var tr = db.TransactionManager.StartTransaction())
{
Point3dCollection p3dc;
foreach (SelectedObject so in psr.Value)
{
p3dc = new Point3dCollection();
var ent = tr.GetObject(so.ObjectId, OpenMode.ForRead) as Entity;
try
{
vl.IntersectWith(ent, Intersect.OnBothOperands, p3dc, new IntPtr(), new IntPtr());
if (ent != null && p3dc.Count > 0)
oic.Add(ent.ObjectId);
}
catch (Exception) { }
}
}
ed.WriteMessage("\n" + oic.Count); thats the code i am currently trying with, and the exception occurs at vl.IntersectWith();
Exception details:
Autodesk.AutoCAD.Runtime.Exception: eNotImplementedYet
at Autodesk.AutoCAD.DatabaseServices.Entity.IntersectWith(Entity entityPointer, Intersect intersectType, Point3dCollection points, IntPtr thisGraphicSystemMarker, IntPtr otherGraphicSystemMarker)
at AcadPlugin.MyCommands.MyIntersection() in e:\DEV\AcadPlugin1.0\AcadPlugin1.0\Commands.cs:Zeile 154.} System.Exception {Autodesk.AutoCAD.Runtime.Exception}
ent = {Autodesk.AutoCAD.DatabaseServices.Solid3d}
so = [Autodesk.AutoCAD.EditorInput.CrossingOrWindowSelectedObject] = {
(((8754286416000),Crossing,6,)
(InfiniteLine,(30825.1342620582,30781.8322475576,4200.53349038419),(-0.577350269189626,-0.577350269189626,-0.577350269189626))
(InfiniteLine,(30315.8322765267,31291.1342330891,4200.53349038419),(-0.577350269189626,-0.5773502691...
Hope this helps.