Jump to content

Recommended Posts

Posted

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?

Posted

What is depth that your refer to? Extrusion THICKNESS ? -David

Posted (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 by David Bethel
Update For Heavy and LW Plines
Posted

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.

Posted

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

Posted

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.

Posted

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.

Posted

Can you post a sample drawing?

Posted

I do not have one but i will create one and post it.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...