TheSwamp

Code Red => VB(A) => Topic started by: Atook on October 10, 2006, 03:21:14 PM

Title: Divide Polyline?
Post by: Atook on October 10, 2006, 03:21:14 PM
I’d like to take a polyline and divide it into equal pieces. Just like the divide command, but in VB(A). When it’s a straight polyline, no problem, as soon as you throw bulges and segments with different slopes it gets more complicated.

Is there an easy way to do this? The Autodesk forums turn up some references to acadx, which has been discontinued, but not much past that.

I’m currently writing in VBA, but would eventually like to port it to VB. I’m writing for r2007.

If there’s a simple way to do this in VB.NET, it might be the trick to get me .NETting.

I believe the hard way will include Brycos post on bulges (http://www.theswamp.org/index.php?page=18). And if there’s only a hard way to do it that someone has coded up and would like to share, I’d be more than happy to make use of it. :)
Title: Re: Divide Polyline?
Post by: Bryco on October 10, 2006, 08:44:44 PM
Atook the math isn't that hard but you may want to use Curve.cls by Frank Oquendo, I use it in 2006 no problems. You need the Vlax as well. This isn't the same as the discontinued acadx it is 2 classes that allow you to access the math functions exposed in lisp (shhh!)
Title: Re: Divide Polyline?
Post by: Glenn R on October 10, 2006, 11:02:10 PM
...or you could use the curve functions directly available in .NET (Acad that is)
ie getParamAtPoint etc.

Cheers,
Glenn.