j_spawn_h Posted October 23, 2014 Share Posted October 23, 2014 I need it to select polylines. then get linetype,depth,length take and add the same like lengths and give quantities for them. example: linetyp - depth - length - qty hidden - 10 - 12 - 3 center - 12 - 12 - 5 hidden - 11 - 8 - 1 Is there something like this? Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 23, 2014 Share Posted October 23, 2014 What is depth that your refer to? Extrusion THICKNESS ? -David Quote Link to comment Share on other sites More sharing options...
j_spawn_h Posted October 23, 2014 Author Share Posted October 23, 2014 Sorry, Yes thickness Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 23, 2014 Share Posted October 23, 2014 (edited) Maybe: [b][color=BLACK]([/color][/b]defun c:ltt [b][color=FUCHSIA]([/color][/b]/ fl al td ln ss i en ed lt tk a l[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]setq td [b][color=MAROON]([/color][/b]tblnext [color=#2f4f4f]"LTYPE"[/color] [b][color=GREEN]([/color][/b]not td[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq ln [b][color=MAROON]([/color][/b]cdr [b][color=GREEN]([/color][/b]assoc 2 td[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]and [b][color=MAROON]([/color][/b]setq ss [b][color=GREEN]([/color][/b]ssget [color=#2f4f4f]"X"[/color] [b][color=BLUE]([/color][/b]list [b][color=RED]([/color][/b]cons 0 [color=#2f4f4f]"*POLYLINE"[/color][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cons -4 [color=#2f4f4f]"<"[/color][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cons 70 8[b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cons 6 ln[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq i 0[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]while [b][color=GREEN]([/color][/b]setq en [b][color=BLUE]([/color][/b]ssname ss i[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]setq ed [b][color=BLUE]([/color][/b]entget en[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]setq tk [b][color=BLUE]([/color][/b]if [b][color=RED]([/color][/b]assoc 39 ed[b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]assoc 39 ed[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] 0[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]setq a [b][color=BLUE]([/color][/b]list ln tk[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]if [b][color=BLUE]([/color][/b]not [b][color=RED]([/color][/b]member a al[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]setq al [b][color=RED]([/color][/b]cons a al[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]setq i [b][color=BLUE]([/color][/b]1+ i[b][color=BLUE])[/color][/b][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]foreach a al [b][color=NAVY]([/color][/b]setq lt [b][color=MAROON]([/color][/b]car a[b][color=MAROON])[/color][/b] tk [b][color=MAROON]([/color][/b]cadr a[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color] [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]cons 0 [color=#2f4f4f]"*POLYLINE"[/color][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]cons -4 [color=#2f4f4f]"<"[/color][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]cons 70 8[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]cons 6 lt[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]cons 39 tk[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 l 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]command [color=#2f4f4f]"AREA"[/color] [color=#2f4f4f]"_E"[/color] en[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq l [b][color=GREEN]([/color][/b]+ l [b][color=BLUE]([/color][/b]getvar [color=#2f4f4f]"PERIMETER"[/color][b][color=BLUE])[/color][/b][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=NAVY]([/color][/b]setq fl [b][color=MAROON]([/color][/b]cons [b][color=GREEN]([/color][/b]list lt tk l [b][color=BLUE]([/color][/b]sslength ss[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] fl[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1 fl[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] The list fl should contain all info on all POLYLINES other than BYLAYER -David Edited October 25, 2014 by David Bethel Update For Heavy and LW Plines Quote Link to comment Share on other sites More sharing options...
j_spawn_h Posted October 24, 2014 Author Share Posted October 24, 2014 Thanks David, but being that I am just learning how to do this. I can not understand why it is not working. I load it and it just goes nil. Also what program are you using to write your code? I like the colored parentheses. I only know about the Vlide (visual lisp) in autocad. Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 24, 2014 Share Posted October 24, 2014 Can you post a sample drawing? I use a color interlace for posting here. I try to make it resemble Ally ( a very old lisp analyzer ) I write the code in a very old ASCII DOS editor ( Q Edit ) -David Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 24, 2014 Share Posted October 24, 2014 Updated Post #4 Give this a try. -David test14.dwg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 24, 2014 Share Posted October 24, 2014 J_spawn_h did you type ltt after loading ? the C:ltt implies ltt can be typed as a command to start the lisp if you want it to run straight away when you load just add (C:ltt) as the last line in the code. You can still run again without reloading typing ltt. Quote Link to comment Share on other sites More sharing options...
j_spawn_h Posted October 25, 2014 Author Share Posted October 25, 2014 Bigal, Yes it says nil David, I down loaded your drawing. it runs in your drawing but not mine. On yours it prints in the text box but does not make a table. I thought it may be the cad version because I forgot to tell you I am using 15. I tried it at my house where I have 11, but still nil. Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 27, 2014 Share Posted October 27, 2014 Can you post a sample drawing? Quote Link to comment Share on other sites More sharing options...
j_spawn_h Posted October 28, 2014 Author Share Posted October 28, 2014 I do not have one but i will create one and post it. 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.