TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: MSTG007 on June 02, 2005, 10:29:10 AM

Title: Total Length Lisp
Post by: MSTG007 on June 02, 2005, 10:29:10 AM
Anyone know of a lisp which gives the total length of lines which you select?

thanks!
Title: Total Length Lisp
Post by: MP on June 02, 2005, 10:36:52 AM
Pretty simple. Modify this (http://www.theswamp.org/phpBB2/viewtopic.php?p=63821#63821) post to suit. Example --

Code: [Select]
(defun c:SumLen ( / getlen len ss i )

    (defun getlen ( object / area )
        (vl-catch-all-apply
           '(lambda ()
                (setq len
                    (vla-get-length
                        object
                    )
                )
            )    
        )
        (if len len 0.0)
    )

    (cond
        (   (setq len 0.0 ss (ssget))
            (repeat (setq i (sslength ss))
                (setq len
                    (+ len
                        (getlen
                            (vlax-ename->vla-object
                                (ssname ss
                                    (setq i (1- i))
                                )
                            )    
                        )
                    )
                )
            )
        )
    )
   
    (if len len 0.0)

)

If you feel more ambitious perhaps modify this (http://www.theswamp.org/phpBB2/viewtopic.php?t=1303) post to suit.

:)
Title: Total Length Lisp
Post by: daron on June 02, 2005, 10:44:37 AM
You might also try putting it in the proper forum too. Oh! I did it for you.
Title: Total Length Lisp
Post by: MP on June 02, 2005, 10:53:07 AM
Doh, missed that, thanks Daron.
Title: Total Length Lisp
Post by: Jürg Menzi on June 02, 2005, 03:22:13 PM
Visit my homepage -> Free Stuff -> Free Programs and search for 'GetLength.lsp'

Cheers
Title: Total Length Lisp
Post by: whdjr on June 02, 2005, 04:27:04 PM
See this (http://www.theswamp.org/phpBB2/viewtopic.php?t=5420) concurrent post.