Jump to content

very dense lwpolyline to be simplified, points density to be reduced?


cat3appr

Recommended Posts

hello,  if you open the RPL.dwg you will see it is super heavy and dense,  this is generated by copy/paste by the  RPL stripped.xlsx  ,Easting and Northing.

I need to simplify this polyline but the first issue is that it is not a polyline, it is a LWPOLYLINE,  so the first thing i tried to convert it into a normal 2D polyline with convertpoly command, but it didn't work.   this is because then I wanted to use a lisp, WEED, to reduce the density of the points and have a more simplified line.  However the lisp won't work because the conversion didn't work and this is still a LWPOLYLINE ....   can anyone recommend another way to reduce the density ? even directly in excel for example ?  

RPL.dwg RPL stripped.xlsx

Link to comment
Share on other sites

I am not quite sure why you had difficulty in converting to a heavy polyline. In my older version, the polyline was converted in a trice to a 2D polyline using CONVERTPOLY.

 

But you could manipulate the data in the spreadsheet. There are about 76000 coordinates. I took every one hundreth coordinate and then plotted them as a polyline. The picture shows them with grips activated.

 

 

deci-deci-mated.PNG

Link to comment
Share on other sites

Like Eldon dump the excel to a csv and just read every 100th point that would be a lisp answer. In excel would write a script file, then load in Autocad, need a vba answer maybe that is what Eldon did. You could save the macro as a txt file and copy and paste into a macro when required.

Edited by BIGAL
Link to comment
Share on other sites

On 8/7/2021 at 2:53 AM, BIGAL said:

Like Eldon dump the excel to a csv and just read every 100th point that would be a lisp answer. In excel would write a script file, then load in Autocad, need a vba answer maybe that is what Eldon did. You could save the macro as a txt file and copy and paste into a macro when required.

thank you Eldon and Bigal, i used this formula found here, which picks every N points, so i set to 100 

=OFFSET($C2,(ROW(A1)*100)-1,0)

image.png.9fa31152d4fe77ae043df352270fe883.png

 

the result is that the first 70 meters are omitted... so the white line is the reduced one.... of course i dont want this

 

 

image.thumb.png.f3eff569d15a5ff8f62b214d8f732574.png

 

also, the lines get offsetted even if for a super tiny distance

image.png.13632c6908ee7ccd8e4dae88c983cc48.png

 

 

is there any other way to reduce ?

 

 

Link to comment
Share on other sites

Why not just use OVERKILL? https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-44B9ECFC-752C-4CC5-9DA3-84DBF3B17CA6

What's wrong with a LWPOLYLINE? When introduced in r14 it reduced drawings I had with contours tenfold. The old type POLYLINE included more connected entities than points while a LWPOLYLINE is a single entity.

Link to comment
Share on other sites

In your data, each line is about 1 unit. If you take any points away, you are bound to get slight gaps from what was there before. You are going to decide what your tolerance is, then you can reduce the number of lines to suit. I thought that OVERKILL only worked on overlapping lines, and there are none here.

 

I use Excel in a simple fashion, but it can process data very powerfully and I am learning every time I use it. In this case I first of all saved the data in CSV format (I could not see any data when I opened the file). Then I used three new columns. I set up a counter =(C1+1), then I set up a condition =IF (MOD(C3,100),A3,0) in column D and a similar one in column E. Then I highlighted those three cells, went down to the bottom of the data, highlighted the same three columns and pressed Control D and the columns were filled and every 100th row had Easting and Northing and the rest were filled with zeroes. I then manually copied over the easting and northing on the first and last lines. I then saved as CSV, opened the file, deleted the first three columns, and then used the Excel facility to delete duplicate data which got rid of all the rows with zeroes except the first one which I manually deleted. I was then left with a deleted file with 770 points. I opened Autocad and started the polyline command. I opened the data file in WordPad, selected all and copied, and then in AutocAD copied the data into the command line. Polyline drawn in a trice!!

 

But the new polyline will only coincide with the old one at every hundredth point.

 

 

divergence.PNG

Link to comment
Share on other sites

On 8/6/2021 at 8:41 AM, cat3appr said:

...... this is generated by copy/paste by the  RPL stripped.xlsx  ,Easting and Northing.

....the first issue is that it is not a polyline, it is a LWPOLYLINE.....

 

If you set the system variable PLINETYPE to 0, then a polyline is drawn as an old type polyline. Setting it to 2 gives a LWPOLYLINE.

 

I finally managed to get an equation or two to work in Excel, and if you take every hundredth point for a new line, the maximum offset from the original polyline is 3.85 to the right and 2.90 to the left.  

  • Like 1
Link to comment
Share on other sites

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