delete Zero length lines
Hi,
I would like a simple script to erase lines with zero length. Any ideas?
0
Comments
-
Try this one:[code](foreach e (vle-selectionset->list(ssget "_X" (list (cons 0 "LINE"))))(if (equal (cdr (assoc 10 (entget e)))(cdr (assoc 11 (entget e)))0.00000001)(entdel e)))[/code]0
-
The code looks better if simply pasted...(ssget "_X" (list (cons 0 "LINE"))))(if (equal (cdr (assoc 10 (entget e)))(cdr (assoc 11 (entget e)))0.00000001)(entdel e)))0
-
The code looks better if simply pasted...(ssget "_X" (list (cons 0 "LINE"))))(if (equal (cdr (assoc 10 (entget e)))(cdr (assoc 11 (entget e)))0.00000001)(entdel e)))That's great thanks Vaidas. I'm only new to writing scripts and I can get it to work if I paste each line in the command line separately, but what will the text look like if I want to make a custom tool? I have this at the moment and it doesn't work. Is there something I'm doing wrong?(foreach e (vle-selectionset->list;(ssget "_X" (list;(cons 0 "LINE"))));(if (equal (cdr (assoc 10 (entget e)));(cdr (assoc 11 (entget e)));0.00000001;);(entdel e););)0
-
Hi Rowan,Remove all semicolons from your code because any text after semicolon is supposed as a comment.The simpliest way to use it is to save the code into YOUR.lsp file and load it with APPLOAD command.0
-
Ok so I've saved I pasted into a text file (See attachment Lisp1)Used APPLOAD to load it (see attachment Lisp2)How do I actually run the command. I did a bit of searching but couldn't find an answer.Thanks in advance!!!lisp1.PNGlisp2.PNG0
-
Got it! had to add the folder to my support file search paths!0
-
Got it! had to add the folder to my support file search paths!Should have added:type:(load "0_lines")That single line of text can be saved as a tool0
This discussion has been closed.