Author Topic: Total Length Lisp  (Read 5183 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Total Length Lisp
« on: June 02, 2005, 10:29:10 AM »
Anyone know of a lisp which gives the total length of lines which you select?

thanks!
Civil3D 2020

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Total Length Lisp
« Reply #1 on: June 02, 2005, 10:36:52 AM »
Pretty simple. Modify this 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 post to suit.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

daron

  • Guest
Total Length Lisp
« Reply #2 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.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Total Length Lisp
« Reply #3 on: June 02, 2005, 10:53:07 AM »
Doh, missed that, thanks Daron.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Total Length Lisp
« Reply #4 on: June 02, 2005, 03:22:13 PM »
Visit my homepage -> Free Stuff -> Free Programs and search for 'GetLength.lsp'

Cheers
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

whdjr

  • Guest
Total Length Lisp
« Reply #5 on: June 02, 2005, 04:27:04 PM »
See this concurrent post.