PDA

View Full Version : Working with polylines


Thawlro
07-04-2005, 12:37 PM
I am building a program that will ask the user to select 3 points. These points can be at any angle. I am then creating a pline object, which I then offset. I am wanting to begin the pline 2” from the first point and 2” inches from the Last point. I have developed a brain cramp on this and cannot figure out how to achieve this objective. :?: Any help would greatly be appreciated :lol:

hendie
07-04-2005, 03:40 PM
begin the pline at 2" where from the first point ? and 2" where from the last point ?
there are an infinite number of points 2" away from any point.

or do you really mean 2" from point X based upon some relationship to the other points selected ?

Thawlro
07-04-2005, 04:04 PM
Yes. The 2" from the first point will be on the angle between the first point selected and the Second point selected.

CarLB
08-04-2005, 12:24 AM
I don't know if it's the geometry/math or the VBA code you're having a problem with. I can't help on the VBA part.

From the user selected points, get the angle between the 2 points. Then to find the new point 2" from Pt1, use a function that determines a new point based on starting point, angle, and distance (is the "polar" command in lisp). To get other point, do the same but start at point 2, and use the original angle plus 180 degrees. If you don't have a "polar" function, then use proportions. You know delta x & delta y between initial 2 points ("big deltas"), and can get distance using the pythagorean thorem. The delta x and y's to the new points are Pt1 coordinates plus "big deltas" times the distance ratios.

(This is all assuming a constant z value)

carsonm
06-02-2006, 03:03 PM
wow! I think I get that. The Answer is always as clear as the question ;-)