TheSwamp

Code Red => .NET => Topic started by: cadplayer on May 29, 2017, 01:25:00 PM

Title: Enclose Points with Polyline
Post by: cadplayer on May 29, 2017, 01:25:00 PM
Hello!

May somebody have a idea to create enclosed Polyline outside from Points in Drawing.
I have a Drawing with many  DbPoints. What I want to do is to create a Polyline which goes over all outer Points.
In Civil3d there is a command with lineworkshrinkwrap, where I can select a block and get a borderline from contours of block.
I would like do the same but not use with command with senttoexecute.

Thank you for inspiration!
Title: Re: Enclose Points with Polyline
Post by: gile on May 29, 2017, 01:40:57 PM
Hi,

Have a look at the ConvexHull (https://www.theswamp.org/index.php?topic=31865.msg430599#msg430599) route.
Title: Re: Enclose Points with Polyline
Post by: cadplayer on May 30, 2017, 01:19:57 PM
Nice Gile, thank you for your work and sharing. Let me think about more - in my case is created Polyline not enclose overall.
Title: Re: Enclose Points with Polyline
Post by: gile on May 30, 2017, 02:32:52 PM
So, did you try the TEST command n the provided link?
Title: Re: Enclose Points with Polyline
Post by: cadplayer on June 01, 2017, 01:15:32 PM
Sorry for delay Gile, yes I have test your function and it´s really nice your thought. I have to configure out a bit more, because it does not draw Polyline(yellow) overall.
http://www.screencast.com/t/DQPecCuwsB (http://www.screencast.com/t/DQPecCuwsB)
Title: Re: Enclose Points with Polyline
Post by: Atook on June 01, 2017, 01:23:08 PM
Good to see the example cadplayer. Is it possible that elevation is causing the dips in the convex hull/shrinkwrap?
Title: Re: Enclose Points with Polyline
Post by: cadplayer on June 02, 2017, 07:41:27 AM
My goal to draw outerline or enclosed Polylines is to set Boundary for calculate Triangulation. Giles example show´s to create 2dPolyline enclosed around selected Points, But I need more exactly line:
black line behind red triangle

http://s1356.photobucket.com/user/cadplayer/media/Triangulate_zps5egmsmru.png.html (http://s1356.photobucket.com/user/cadplayer/media/Triangulate_zps5egmsmru.png.html)

Here is my example to get enclosed lines
Code: [Select]

        public static void ObjectsToEnclose(Entity acEnt)
        {
            Document acDoc = Application.DocumentManager.MdiActiveDocument;

            string strHandle = acEnt.Handle.ToString();
            acDoc.SendStringToExecute("lineworkshrinkwrap ", true, false, false);

            string command = string.Format("(handent \"" + strHandle + "\") ");
            acDoc.SendStringToExecute(command, true, false, false);
        }

Works only in Civil3d or MAP