TheSwamp

Code Red => .NET => Topic started by: bikelink on October 20, 2010, 05:48:13 PM

Title: does working SelectWindowPolygon just with 4 points ?
Post by: bikelink 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..
Title: Re: does working SelectWindowPolygon just with 4 points ?
Post by: Jeff_M 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.
Title: Re: does working SelectWindowPolygon just with 4 points ?
Post by: bikelink 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
Title: Re: does working SelectWindowPolygon just with 4 points ?
Post by: Jeff H on October 20, 2010, 07:13:35 PM
Yes you can
Title: Re: does working SelectWindowPolygon just with 4 points ?
Post by: bikelink 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!
Title: Re: does working SelectWindowPolygon just with 4 points ?
Post by: bikelink on October 20, 2010, 07:38:34 PM
ok , sorry but with this points i haven't intersections
(http://i55.tinypic.com/fm6uzl.jpg)
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!
Title: Re: does working SelectWindowPolygon just with 4 points ?
Post by: bikelink 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...!