Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reduce Polyline points

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
Anonymous
17647 Views, 19 Replies

Reduce Polyline points

Hi, 

I realize there are many posts about this but they all seem to be old and none of them are working for me. 

I am running AutoCAD 2019 fully up to date. I have attached a sample file. 

The program I use to convert a raster file to vector works very well at created an accurate conversion. Unfortunately this seems to mean that it creates a TON of nodes. 

If someone knows a way to reduce the amount of vertices in the polylines, I am all ears!

 

Thanks

Sandro

19 REPLIES 19
Message 2 of 20
Patchy
in reply to: Anonymous

PLdiet.lsp from Kent works just fine.

 

Capture.JPG

Message 3 of 20
Anonymous
in reply to: Patchy

Hi, 

This seems to be exactly what I am looking for. Can you please explain to me how you did this?

Message 4 of 20
Patchy
in reply to: Anonymous

Go to Cadalyst and download the PLdiet.lsp, Use apload command and load it, after that use PLD command.

There are a few options in this routine for you to pick for the polylines.

http://cadtips.cadalyst.com/linear-objects/polyline-diet

Message 5 of 20
Kent1Cooper
in reply to: Patchy


@Patchy wrote:

Go to Cadalyst and download the PLdiet.lsp....


 

Thanks for the recommendation and link.  The comment there is because I hadn't included a little function -- (vl-load-com) -- that some people need [I don't because it's taken care of elsewhere, so I haven't always remembered to include it], and unfortunately they're not accepting comments any more, so I can't fix it there, but here's a version with that added, so you shouldn't have that Commenter's problem.

Kent Cooper, AIA
Message 6 of 20
Anonymous
in reply to: Patchy


@Patchy wrote:

Go to Cadalyst and download the PLdiet.lsp, Use apload command and load it, after that use PLD command.

There are a few options in this routine for you to pick for the polylines.

http://cadtips.cadalyst.com/linear-objects/polyline-diet


ok so i think i got this downloaded properly because I now have a new command that was previously not available to me. Can you please tell me your input selection that gave you this output? I am messing around with it and cant seem to get it to work for me.

Message 7 of 20
Patchy
in reply to: Anonymous

Use 0.05 for distance

Capture.JPG

After that use Pedit, Multiple and Join.

Capture 1.JPG

Message 8 of 20
Anonymous
in reply to: Patchy

Awesome! This works great. I previously had zero experience with .lsp 

 

I am going to be using this so often. I am very thankful to you for showing me this and to the creators!

 

One more question. I noticed the command was no longer available when I closed the file and then reopened it. Is there a way to have this command permanently available to me without having to use the appload command?

Message 9 of 20
Patchy
in reply to: Anonymous

Yes, after the Appload command, look for the Suitcase and add that lsp in there.

Message 10 of 20
Anonymous
in reply to: Patchy

it works! perfect thank you.

Message 11 of 20
Anonymous
in reply to: Kent1Cooper

I'm totally lost here. I have downloaded that PLDiet.lsp file that you have posted but I have no idea where to put it and how to get it to run. Can you please help me out with this. 

THanks 

Message 12 of 20
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

.... I have downloaded that PLDiet.lsp file that you have posted but I have no idea where to put it and how to get it to run. ....



In a drawing, use the APPLOAD command, navigate to where you saved the file, select it and Load it.  Close out of that, and use the command name PLD.

Kent Cooper, AIA
Message 13 of 20
Anonymous
in reply to: Kent1Cooper

Ok I have tried this but it does nothing. Maybe because Im using AutoCad LT2020? I typed appload into the command bar but it says invalid command. Not sure what to do 

Message 14 of 20
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

.... it does nothing. Maybe because Im using AutoCad LT2020? ….


Exactly.  LT does not have AutoLisp capability.

Kent Cooper, AIA
Message 15 of 20
3dwannab
in reply to: Kent1Cooper


@Kent1Cooper wrote:

@Patchy wrote:

Go to Cadalyst and download the PLdiet.lsp....


 

Thanks for the recommendation and link.  The comment there is because I hadn't included a little function -- (vl-load-com) -- that some people need [I don't because it's taken care of elsewhere, so I haven't always remembered to include it], and unfortunately they're not accepting comments any more, so I can't fix it there, but here's a version with that added, so you shouldn't have that Commenter's problem.


 

I was wondering if there was a way around the error when using this inside block editor.

 

Thanks.

 

** UCS command not allowed in block editor. **

 

Message 16 of 20
Kent1Cooper
in reply to: 3dwannab


@3dwannab wrote:
....

I was wondering if there was a way around the error when using this inside block editor.

** UCS command not allowed in block editor. **

 

Unfortunately, I don't think so.  PLD doesn't try to change the UCS unless  the Polyline in question is not in or parallel to the current Coordinate System.  In that case, it must  change the UCS to work right, because its operations depend on (angle) and (distance) functions, which work projected onto the current construction plane.  So if that plane is not at least parallel to  the plane of the Polyline [the Polyline doesn't actually need to lie on  it], it won't give correct results.

 

[But when you can  use it, use the updated version >here<.]

 

I suggest that you Insert such a Block somewhere in isolation, EXPLODE it, run PLD on the Polyline, and then re-define back into the same Block name with the svelte new Polyline.

Kent Cooper, AIA
Message 17 of 20
3dwannab
in reply to: Kent1Cooper

Thanks. I was wondering what had happened the cadalyst site where I couldn't comment.

I was doing it that way but thought I'd ask you if the ucs command was heavily required.

 

I don't have time to look at it but it could be possible to copy the polylines into a new drawing, close that and paste back into the block editor at the same position replacing the old lines.

 

Message 18 of 20
3dwannab
in reply to: Kent1Cooper

I don't know where I got the last PLD but it had reporting, in the end, showing what had changed, like so.

 

137-->51 (-62.77% )
17-->8 (-52.94% )
10-->6 (-40.00% )
3 polylines simplified.

I've added that back in for anyone that wants it.

 

 

Message 19 of 20
chloeleyba8NWHJ
in reply to: Anonymous

Hi all, I'm new to this forum. but have many years of CAD experience. I recently switched over to CAD for MAC, and wow there are a lot of differences. With that said, I'm trying to get the PLDiet.lsp to work on MAC. It loads up fine and even shows the prompts to run this function. But in the end I get an error message. I'll show......

 

 

Command: pld
Maximum distance between non-collinear vertices to straighten <0.05>:
Maximum change in direction to straighten <15>:
Retain or Straighten arc segments [R/S] <R>:
Select LWPolylines to put on a diet, or press Enter to select all:
Select objects: 0 found
Select objects: Specify opposite corner: 16 found, 16 total
Select objects:
Error: no function definition: VLAX-CURVE-GETSTARTPOINT
Cannot invoke (command) from *error* without prior call to (*push-error-using-command*).
Converting (command) calls to (command-s) is recommended.

 

Any help appreciated. 😊

Message 20 of 20


@chloeleyba8NWHJ wrote:

....

Error: no function definition: VLAX-CURVE-GETSTARTPOINT

....


Message 5 is about exactly that.  If those (vl...) functions in the updated PLDiet there don't work in the Mac version, there may be nothing you can do.  The routine uses them for critical purposes, and I'd have to think about whether there's a different way to accomplish them.  The one listed in that error message could be, but the (vl-remove...) and (vl-remove-if...) and (vl-remove-if-not...) ones later would probably require a major change in approach and a lot of re-write.

Kent Cooper, AIA

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report