Jump to content

Lisp - line endpoints to nearest nodes


Recommended Posts

Posted

Like Lee's answer a pline has a direction depending on how it was drawn. So just getting only end or start point may still give an incorrect answer. Another way is pick a line near an end that way it implies which end is say start point and its to be moved only. As Lee has suggested it may work for you if lines are always drawn in a direction CW or CCW. If not post sample dwg.

2 plines in opposite directions.

image.png.f43aac47c8aa091c5a39862a9ed40c4e.png

Posted
17 hours ago, BIGAL said:

Like Lee's answer a pline has a direction depending on how it was drawn. So just getting only end or start point may still give an incorrect answer. Another way is pick a line near an end that way it implies which end is say start point and its to be moved only. As Lee has suggested it may work for you if lines are always drawn in a direction CW or CCW. If not post sample dwg.

2 plines in opposite directions.

image.png.f43aac47c8aa091c5a39862a9ed40c4e.png

Hi Bigal, I agree with you. Based on the Cadworker's request, if there are some polylines drawn in vice versa directions and some times randomly. and if there is a gap between the point and the lines then the lisp should rectify and adjust the nearest end point. Instead of shifting just the ends or starts.

Posted

The simple answer is to look around both end points for a node and move the correct end to correct node. It's been done many times use a SSGET "CP" that uses like a circle style to look inside for a node for a given maximum range. Will try to find again.

  • 2 weeks later...
Posted
On 12/9/2023 at 10:44 AM, BIGAL said:

Need a dwg to play with don't want to do code more than once.

SNAP-TO-END.dwg

Hi, Bigal.. Sorry for the delay. Here is the attached drawing file.

Posted (edited)

Now that have a real dwg need a different approach all together. Added to my to do list, some one else may jump in sooner.

 

I think to represent better need control lines as intersecting points, this will give a more realistic bend in the plines. All sorts of complications are creeping in re scaling along line versus distance between points, else last copy will look odd either cross or be to big a offset from last pline.

 

image.png.d54441c4b179efbafec09d7712a97247.png

 

I quickly made a copy answer so that is where I realised the plines look wrong.

 

Will think some more.

Edited by BIGAL
Posted
18 hours ago, BIGAL said:

Now that have a real dwg need a different approach all together. Added to my to do list, some one else may jump in sooner.

 

I think to represent better need control lines as intersecting points, this will give a more realistic bend in the plines. All sorts of complications are creeping in re scaling along line versus distance between points, else last copy will look odd either cross or be to big a offset from last pline.

 

image.png.d54441c4b179efbafec09d7712a97247.png

 

I quickly made a copy answer so that is where I realised the plines look wrong.

 

Will think some more.

This is a bunch of pipes, which is surveyed by 2 surveyors one at each end. Here Only the width of the Bunch and the number of lines are important. in between its not so important. So I offset a few from each side and adjust to the points.

Posted

Ok I still think adding control points would be better way to go as it would calc intermediate points, bearing in mind say for sample dwg creation would be instant. In my To do.

  • Like 1
  • 1 month later...
Posted

Considering the sample drawing, is there any way of offsetting any selected line / polyline and then selecting the multiple points and then the lines/polylines are created? Just like a regular offset command with multiple options.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...