Hi Its not mine, I made some changes .
I have permission from author to spread it.
(defun c:Excel ()
;;;; DESARROLLO DE PROGRAMAS PARA CONSTRUCCION-ALEJANDRO LEGUIZAMON- arquingeneu@gmail.com
(vl-load-com)
(setq *AplExcel* (vlax-get-or-create-object "excel.application")
*ColeccionLibros* (vlax-get-property *AplExcel* "Workbooks")
*NuevoLibro* (vlax-invoke-method *ColeccionLibros* "add")
*ColeccionHojas* (vlax-get-property *NuevoLibro* "Sheets")
*Hoja1* (vlax-get-property *ColeccionHojas* "Item" 1)
*CeldasExcel* (vlax-get-property *Hoja1* "Cells")
)
(vla-put-visible *AplExcel* :vlax-true)
(setq fila 3)
(setq n 0)
(setq seleccion (ssget))
(setq cantidad (sslength seleccion))
(repeat cantidad
(setq nombre (ssname seleccion n))
;; (setq valor (vlax-curve-getArea nombre))
(setq fin (vlax-curve-getendparam nombre))
(setq principio (vlax-curve-getStartParam nombre))
(setq pto-fin (vlax-curve-getEndPoint nombre))
(setq longitud (vlax-curve-getDistAtPoint nombre pto-fin))
(setq valor longitud)
(vlax-put-property
*CeldasExcel*
"Item"
fila
2
(vl-princ-to-string valor)
)
(setq lista (entget nombre))
(SETQ capa (CDR (ASSOC 8 lista)))
(SETQ punto (ASSOC 10 lista))
(setq x (cadr punto))
(setq y (caddr punto))
;;(command "_zoom" "c" (list x y) "5")
(vlax-put-property
*CeldasExcel*
"Item"
fila
1
(vl-princ-to-string capa)
)
;;(setq t1 "Ingresa Altura ò Peralte de ")
;(setq tt (strcat t1 capa ))
;(print tt)
;(setq H (getreal))
;(vlax-put-property *CeldasExcel* "Item" fila 3
;(vl-princ-to-string H))
;(setq volumen (* valor H))
;(vlax-put-property *CeldasExcel* "Item" fila 4
;(vl-princ-to-string volumen))
(setq n (+ n 1))
(setq fila (+ fila 1))
)
(vlax-put-property
*CeldasExcel*
"Item"
1
1
(vl-princ-to-string
"Rutina Autolisp para calculo de longitud - ALEJANDRO LEGUIZAMON - http://arquingen.tripod.com.co--modif por DEVITG"
)
)
(vlax-put-property
*CeldasExcel*
"Item"
2
1
(vl-princ-to-string "capa")
)
(vlax-put-property
*CeldasExcel*
"Item"
2
2
(vl-princ-to-string "Longitud")
)
;(vlax-put-property *CeldasExcel* "Item" 2 3
;(vl-princ-to-string "Altura"))
;(vlax-put-property *CeldasExcel* "Item" 2 4
;(vl-princ-to-string "volumen"))
(vlax-release-object *CeldasExcel*)
(vlax-release-object *Hoja1*)
(vlax-release-object *ColeccionHojas*)
(vlax-release-object *NuevoLibro*)
(vlax-release-object *ColeccionLibros*)
(vlax-release-object *AplExcel*)
)
(c:excel)
;|«Visual LISP© Format Options»
(72 2 50 2 nil "end of " 60 9 0 0 0 T T nil T)
;*** DO NOT add text below the comment! ***|;