issammesk Posted August 19, 2014 Share Posted August 19, 2014 hi all please i need lsp to erase alot of line have same length i mean i nead lsp to ask me about length then example i give him 65m automtic erase all line have this length Quote Link to comment Share on other sites More sharing options...
ReMark Posted August 19, 2014 Share Posted August 19, 2014 Exactly that length or any line that is at least that length? There is a difference. Quote Link to comment Share on other sites More sharing options...
issammesk Posted August 19, 2014 Author Share Posted August 19, 2014 yes sir i mean lsp ask me about length to select then i enter any length example 40m..... automatic select any line in drwing have same length (40M) Quote Link to comment Share on other sites More sharing options...
ReMark Posted August 19, 2014 Share Posted August 19, 2014 You can start with the code posted in the second response (by Jason Piercey) to this thread and work from there. http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Selection-set-by-length/td-p/905474 Quote Link to comment Share on other sites More sharing options...
David Bethel Posted August 19, 2014 Share Posted August 19, 2014 Maybe: [b][color=BLACK]([/color][/b]defun c:dellinel [b][color=FUCHSIA]([/color][/b]/ d f ss i en ed[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]initget 7[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq d [b][color=NAVY]([/color][/b]getdist [color=#2f4f4f]"\nLine Length To Erase: "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]initget 4[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq f [b][color=NAVY]([/color][/b]getdist [color=#2f4f4f]"\nLength Fuzz Factor <1e-8>: "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]or f [b][color=NAVY]([/color][/b]setq f 1e-8[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget '[b][color=GREEN]([/color][/b][b][color=BLUE]([/color][/b]0 . [color=#2f4f4f]"LINE"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq i 0[b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss i[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]if [b][color=GREEN]([/color][/b]equal [b][color=BLUE]([/color][/b]distance [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]assoc 10 ed[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]assoc 11 ed[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] d f[b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]entdel en[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq i [b][color=GREEN]([/color][/b]1+ i[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] This does not exclude 3D lines. -David Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.