.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Move a polyline parallel to other polylines

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mdolanVQYAA
140 Views, 2 Replies

Move a polyline parallel to other polylines

I am looking for the best method of moving the red polyline to be completely between the R/W and BOC polylines. Two feet from the R/W to be exact.  I have the R/W polylines green and cyan just to show that there are two of them along the length of the red line.  There could be multiple of the BOC too.

 

mdolanVQYAA_1-1733852101114.png

 

I can find both the closest point on a BOC and RW polylines to any given point on the red line. I can then figure out if it is inside or not. I can figure out where it intersects and stick a new vertex in the red line to keep it inside. That gets it inside but it still looks bad.

 

Ideally what I am looking for is a way to make the red line have all the vertices of the R/W polylines it runs along.  Ideally the red line would end up looking like this.

 

mdolanVQYAA_2-1733852554075.png

 

Thank you.  Any guidance or examples are greatly appreciated.

2 REPLIES 2
Message 2 of 3
_gile
in reply to: mdolanVQYAA

Hi,

You should have a look at the Curve.GetOffsetCurves method.

You can also use or get inspiration from the Polyline.Offset extension method from Gile.AutoCAD.Extension library.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 3
mdolanVQYAA
in reply to: _gile

That got me pointed in the right direction. Nice extension library BTW.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report