Need to eliminate hundreds of unwanted vertices from drawing but autocad 2000 doesn't have "weed" command.

Need to eliminate hundreds of unwanted vertices from drawing but autocad 2000 doesn't have "weed" command.

jimschmidt
Enthusiast Enthusiast
10,908 Views
35 Replies
Message 1 of 36

Need to eliminate hundreds of unwanted vertices from drawing but autocad 2000 doesn't have "weed" command.

jimschmidt
Enthusiast
Enthusiast

My autocad 2000 drawings produce hundreds or more vertices that cause problems for my waterjet machinist.  I'm told the way to get rid of vertices is to use the "weed" command which is not available in autocad 2000.  Please help.

0 Likes
Accepted solutions (1)
10,909 Views
35 Replies
Replies (35)
Message 2 of 36

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

this is now the 3rd thread opened with the same basic question.

Please stay in one thread instead of opening multiple ones, this is more work for those who help, and more work for you too as you have to reply to multiple threads, even equal questions or suggestions.

There also exist suggestions which you have not replied to (yet).

 

WEED is not a command in AutoCAD 2000, nor on AutoCAD 2021, functions for weeding vertices can be found in AutoCAD Map 3D and Autodesk Civil 3D or in 3rd party tools, but not in Vanilla AutoCAD.

 

From the drawing you showed >>>here<<< you had about 240 vertices for the complete curves (text and dimension not included), reducing number of vertices means reducing accuracy. E.g. you can't remove a vertex from a rectangle and see again a rectangle with just 3 points.And it sounds strange if you have curves with 240 vertices and you want to remove hundreds of them!

Same for your drawing, you might remove some vertices, but then the geometry is not the same any more.

 

And to be honest, I really have a problem thinking about issues with curves with 240 vertices. What exactly does the other tool that reads your DXF-file tell you, how many vertices does it find? Is it verified that the text objects are ignored because if these objects are not ignored then yes, then you have a lot more than 1000 vertices.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 36

Kent1Cooper
Consultant
Consultant

WEED is not an AutoCAD command.  It's an AutoLisp routine written by Jerry Workman, originally in 1987.  It's available >here<, and there's a WEED2 by Skyler Mills from 1998 [I'm not sure what the differences are] that's >here<.  But be aware that those work only on "heavy" 2D Polylines.  If you pick on one of yours, and in the Properties palette it says it's a "2D Polyline," those should work.  If it says it's a "Polyline," that means it's a "lightweight" one, and you can use my routine written to work on those, PLDIET.lsp with its PLD command, >here<.  [You'll find it in other places, too, but that's the latest version.  If it doesn't work on older AutoCAD, try Searching in the Customization Forum for the earliest version you can find.]

Kent Cooper, AIA
0 Likes
Message 4 of 36

jimschmidt
Enthusiast
Enthusiast

I have the "weed.Isp" file by jerry workman.  How do I apply it?  My PC doesn't have an application for Isp files.

 

In the quick select section of the properties palete it give my a choice to select either line or 2D polyline.  No where else does it indicate polyline or 2Dpolyline

0 Likes
Message 5 of 36

Kent1Cooper
Consultant
Consultant

@jimschmidt wrote:

I have the "weed.Isp" file by jerry workman.  How do I apply it?  My PC doesn't have an application for Isp files.

 

In the quick select section of the properties palete it give my a choice to select either line or 2D polyline.  No where else does it indicate polyline or 2Dpolyline


That's an L, not an I -- if all-capitalized, WEED.LSP.  But even if you have it spelled right in the file name, your computer wouldn't have an application associated with .LSP files, because you don't run it alone, but only inside AutoCAD.  In a drawing, type AP [the alias for the APPLOAD command], navigate to where you put the file, and Load it.  Without opening it, I'm not sure, but I expect the command name is also WEED -- it's whatever immediately follows  (defun C:  in the file.

 

You have a Line object coinciding with the Polyline at the place where you selected it, which is why it gave a choice of which to select.  But if the other option it's offering is a 2D Polyline, then WEED [or WEED2] would be applicable, and PLD would not.  You could also use CONVERTPOLY to make it a lightweight one, and use PLD on it.  That has some advantages:  it remembers your distance and amount-of-bend-angle limit choices, and offers them as defaults on subsequent use.  And it removes all vertices along collinear stretches, no matter how many, even if longer than your distance limit [which I don't think WEED does, though I haven't confirmed that].

Kent Cooper, AIA
0 Likes
Message 6 of 36

jimschmidt
Enthusiast
Enthusiast

I loaded the weed.Lsp file.  Opened the drawing and gave the weed command.  It asks me for the offset distance  (.1), the leg length (.1), to delete the original polyline y/n (if I choose yes it says spline curve vertices have been added), to decuve polyline duning weeding y/n (No is the only option that lets me continue),  After a few tries the attached drawing is what I get which is useless.  If I try offset or leg length of .01 then nothing happens.  

 

When I tried convertpoly I get the choice heavy or light but either choice gives me "0 objects converted)

 

Got any options that would work?

0 Likes
Message 7 of 36

ВeekeeCZ
Consultant
Consultant

This reduced number of vertices significantly.

EXPLODE, JOIN, PLDIET 7 3 S

 

Or another method.

SPLINEDIT, FLATTEN

0 Likes
Message 8 of 36

Kent1Cooper
Consultant
Consultant

@jimschmidt wrote:

....if I choose yes it says spline curve vertices have been added).....  

When I tried convertpoly I get the choice heavy or light but either choice gives me "0 objects converted)

....


That shape is made of Polylines that have had PEDIT's Spline option used on them.  You can tell by the control points not being on the curve, and there not being any mid-segment grips:

Kent1Cooper_0-1615205628995.png

That's one of the situations where "heavy" 2D Polylines occur -- they result from applying that option or the Fit option to a "lightweight" one.  Those can't be CONVERTPOLY'd [as you have found], and it appears WEED doesn't want to work with them, either.  You could try PEDIT's Decurve option on it first, and then try WEED again.

 

I haven't loaded WEED to try [because I virtually never have "heavy" 2D Polylines], but PLD was written pretty much to do the same kind of thing to the "lightweight" ones.  I forget WEED's particulars after all these years, but if PLD's operation is similar to it, that distance option is a maximum distance to straighten.  It won't remove a vertex if it will result in a segment longer than that maximum.  Even in the LWPolyline [the cyan one] in your drawing, which you can apply PLD to, if that were a "heavy" one that you could apply WEED to, your 0.1 distance choice is much too small for any vertices to be removed, because the spacing between vertices is mostly in the 1.0 to 1.5 range.  You need to give it a distance that is greater than the length of segments you want reduced in quantity.

 

But of course, the reason for the high number of vertices, and for using PEDIT's Spline option, is to achieve a reasonably curvy appearance, or actual smooth curvature.  If you remove vertices, it will get "kinkier," so you need to decide how kinky is acceptable.

 

[I need to revisit PLDiet, under newer versions than it was written in -- it's not behaving right on the cyan Polyline in your sample drawing.  I couldn't say whether WEED is similarly affected by version.]

[[EDIT:  No, maybe I don't -- I find that your cyan LWPolyline has large numbers of coincident vertices, which can cause problems with all manner of things.  The second vertex location has 8 vertices, all in the same place!  The third location has 9, and the fourth location has 12 !  When I got rid of those with OVERKILL, PLD worked as expected.  I couldn't say whether WEED would have trouble with similar conditions.]]

Kent Cooper, AIA
Message 9 of 36

jimschmidt
Enthusiast
Enthusiast

I sent the files you modified to my machinist and he says that the problem is fixed - great.  What program did you use and how can I have this done without having to purchase a new AutoCad version?

0 Likes
Message 10 of 36

jimschmidt
Enthusiast
Enthusiast

Is there a LSP app I can load into my AutoCad 2000 that would give me:

EXPLODE, JOIN, PLDIET 7 3 S

Or 

SPLINEDIT, FLATTEN

commands?

0 Likes
Message 11 of 36

ВeekeeCZ
Consultant
Consultant
Accepted solution

It was 2020. All are build-in commands but Kent's PLDIET routine.

 

I believe that all commands should be available in 2000 somehow. You need to have Express Tools installed. For joining you might need to use PEDIT. ---- These all were just tips for you to see possibilities but you need to explore them yourself. Open HELP, search GOOGLE. Can't help you anymore.

Good luck!

0 Likes
Message 12 of 36

jimschmidt
Enthusiast
Enthusiast

Please at least tell me what "7 3 S" means in the PLdiet command you wrote

0 Likes
Message 13 of 36

Kent1Cooper
Consultant
Consultant

If you load PLDiet.lsp and try the PLD command, you'll see:

 

Command: PLD
Maximum distance between non-collinear vertices to straighten: 7

Maximum change in direction to straighten <15>: 3

Retain or Straighten arc segments [Retain/Straighten] <S>: S

To put LWPolyline(s) on a diet {All option available},
Select objects:

 

That won't be able to be put into something like an AutoLisp (command) function, since PLD is not an AutoCAD command, but it should be able to be put into a command macro in a Tool Palette button.  Whether that will work along with the other things requested, I haven't explored -- maybe later.

Kent Cooper, AIA
0 Likes
Message 14 of 36

Anonymous
Not applicable

Hello!

I am trying to load  PLDiet.lsp by  @Kent1Cooper on AutoCAD 2022 for Mac OS and it doesn't seem to load. Any help would be appreciated. I'm trying to remove an insane amount of vertices within polylines converted from splines imported Illustrator DWG. Trying to cleanup my shapes to send to laser cutter. Thank you in advance! Chris

0 Likes
Message 15 of 36

Patchy
Mentor
Mentor

Maybe you should post your question in the MAC user forum.

Or post your drawing here if you need help solving it.

0 Likes
Message 16 of 36

Anonymous
Not applicable

Hi! Thank you! Here is the drawing. I would be great to reduce the complexity w/o loosing any curvature. Any advise you could provide would be greatly appreciated! 

0 Likes
Message 17 of 36

Patchy
Mentor
Mentor

Try this one, if needed tighter curves, please specify the length.

 

0 Likes
Message 18 of 36

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... to reduce the complexity w/o loosing any curvature. .... 


That's not possible.  The complexity is what creates the "curvature."  It's not really curvature in your drawing, but relatively short line segments, bending along the "curves."  If you reduce the number of vertices, the line segments must get longer, and the bends farther apart, and the curvature cannot do otherwise than get less curvy.

Kent Cooper, AIA
0 Likes
Message 19 of 36

Anonymous
Not applicable

Hi there, I don't think I'm seeing any difference. Complexity seems the same. (sorry I'm a CAD neophyte, learning to swim in the deep end here!) Seems like I should be able to save a DWG made of simple lines and arcs w/o all the intermediary points. (again I know nothing) I originally loaded an Illustrator DWG made of all splines. I then converted splines to polyline 2D, then converted that down to polyline. My previous experience is creating bezier based vector art in Adobe Illustrator. Most CNC systems had been able to process my files, but I am having troubles with this one particular laser cutter. 

0 Likes
Message 20 of 36

Patchy
Mentor
Mentor

Sure there is a difference, copy those 2  polylines off the main drawing, use EXPLODE on both and try erase command, there are different numbers on entities.

If you want them to have bigger length, then you will destroy the shape.

0 Likes