Author Topic: does working SelectWindowPolygon just with 4 points ?  (Read 1849 times)

0 Members and 1 Guest are viewing this topic.

bikelink

  • Guest
does working SelectWindowPolygon just with 4 points ?
« on: October 20, 2010, 05:48:13 PM »
inside this area i have a circle..


lpt.Add(new Point3d(5.0, 5.0, 0.0));
               lpt.Add(new Point3d(13.0, 15.0, 0.0));
               lpt.Add(new Point3d(12.0, 9.0, 0.0));
               lpt.Add(new Point3d(5.0, 12.0, 0.0));
               lpt.Add(new Point3d(5.0, 5.0, 0.0));


// if I add the red row  SelectWindowPolygon return Error. without this its return the objects.

               PromptSelectionOptions Opts = new PromptSelectionOptions();
               Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
               Point3dCollection Polygon = new Point3dCollection(lpt.ToArray());
               PromptSelectionResult res   = ed.SelectWindowPolygon(Polygon);

maybe I'm a stupid...but i Guess that a polygon could be have more then 4 vertex..

Jeff_M

  • King Gator
  • Posts: 3916
  • C3D user & customizer
Re: does working SelectWindowPolygon just with 4 points ?
« Reply #1 on: October 20, 2010, 06:12:38 PM »
If you draw the polygon defined by the points you gave you get the item shown in the attached picture. I don't think WindowPolygons can cross like this.

bikelink

  • Guest
Re: does working SelectWindowPolygon just with 4 points ?
« Reply #2 on: October 20, 2010, 06:48:30 PM »
of course...if I give this shape I'm going to shot myself!
i talk about a shape with 4 or 5 vertex with a "sense" that it can be closed without intersections

Jeff H

  • Needs a day job
  • Posts: 5937
Re: does working SelectWindowPolygon just with 4 points ?
« Reply #3 on: October 20, 2010, 07:13:35 PM »
Yes you can

bikelink

  • Guest
Re: does working SelectWindowPolygon just with 4 points ?
« Reply #4 on: October 20, 2010, 07:23:40 PM »
ok...to write code after 1 am isn't a good choice...
now i must to verify the sequence of points! damn!

bikelink

  • Guest
Re: does working SelectWindowPolygon just with 4 points ?
« Reply #5 on: October 20, 2010, 07:38:34 PM »
ok , sorry but with this points i haven't intersections

that's a real situation.


              lpt.Add(new Point3d(2526.11913296339, 4761.82097707599, 0));
               lpt.Add(new Point3d(2250.71913296339, 4761.82097707599, 0));
               lpt.Add(new Point3d(2299.01913296339, 4713.52097707599, 0));
               lpt.Add(new Point3d(2526.11913296339, 4713.52097707599, 0));
               lpt.Add(new Point3d(2526.11913296339, 4761.82097707599, 0));



the shape (black color)  is regular, without intersections (i moved out from others lines in order to show it)

under this points we have some entities but the selection fails!

bikelink

  • Guest
Re: does working SelectWindowPolygon just with 4 points ?
« Reply #6 on: October 20, 2010, 07:46:32 PM »
OK GOOD ...
i must to make a little offset ..else  nothing is really fully inside ! just a very little offset.. :lmao:!

Thank You...!