Jump to content

Recommended Posts

Posted

Dear friends,

I am new to the forum and new to lisp coding. I need your help to build some lisp routines.

 

1. My first problem is to improve the weed.lsp written by Jerry Workman. I have a task to simplify road center lines of cities (each city has hundreds of lines). The weed.lsp written by Jerry Workman however only deals with one pline each time. There has been some new development in vertex reduction routines like pvd.lsp and pldiet.lsp, both of which can process many plines at a time. But I still prefer the original weed.lsp because of its algorithms. It uses offset distance from (extranious) verticies to control simplification rather than angle of deviation of segments. This gives a better result for my kind of work.

 

Therefore, what I need is to allow the weed.lsp (please find the original lisp from attachments) to process multiple plines by cross window selection.

 

2. The second problem is to merge close intersections of lines (please also see attachment dwg file for effect before and after treatment). What I need is selecting all lines or lines by cross window selection and finding line intersections within a fuzzy distance, then keeping the intersection point on the longest line as an anchoring point (marked by red circle on the jpg image), and finally stretching all other points within the distance to that anchoring point.

 

Any of your help or suggestion is highly appreciated! BTW, I am using autocad 2008.

merge neighboring intersection points.dwg

weed.lsp

merge neighboring intersection points.jpg

Posted

This is the key line (entsel "\nSelect a PolyLine or Line: ") you need to change this to be a ssget & filter for line ,pline. Then you would do a loop stepping through this selection using the original weeds code, sorry have another task at moment can not help.

 

The second task joining nearby lines thinking about it may be a case of the way some triangular networks are generated find a centre and spiral out comparing line end points.

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...