help finish modifying lisp

help finish modifying lisp

Edwin.Saez
Advisor Advisor
2,674 Views
30 Replies
Message 1 of 31

help finish modifying lisp

Edwin.Saez
Advisor
Advisor

 

Hello everyone,

 

I find myself modifying a lisp, but I have not been able to move forward anymore due to lack of knowledge of lisp, I hope you can help me improve it or finish it.
I will attach the dwg so you can see what I am doing.

1- The lisp what it does is get the length of each line, which are each in its layer. (Could you improve so that the lisp allows me to select the lines?
2- the output of the data is through the texts that they see there, where the quantities are seen (they could improve the output of the data so that I wonder if I want to take them to excel or place them inside the dwg as a table)
3- the output of the data is placed as a table within the dwg

 

(defun c:sumlp (/ p l e sxy exy sum1 sum2 sum3 sumpdp200 sumNpdp200 sumpdp300 sumNpdp300 sumpdp450 sumNpdp450 sumpdp600 sumNpdp600 sum1550 sum17200 sum17300 sum17450 sum17600 sum21200 sum21300 sum21450 sum21600 sum21750 sum21900)

(setq pick_pt_orig (getpoint "\nPunto de Insercion de Salida de datos:"))
   
(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")

                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_PD Perf 50")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)

         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sumpdp50 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_PD Perf 50: ")
         (princ (rtos sumpdp50))

(setq b (+ 0.05 0.6))
(setq h (+ 0.05 0.5))
(setq vgi (* b h))
(setq vcai (* 0.1 b))
(setq vri (* 0.2 b))
(setq vexi (+ vgi vcai))
(setq vexi (+ vexi vri))
(setq vg vgi)
(setq vca vcai)
(setq vr vri)
(setq vex vexi)
      
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumpdp50 2 0) "M  tubería de HDPE de pared doble perforada de D=50 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vgi 2 2) "M3  volumen de grava por tubería de HDPE de pared doble perforada de D=50 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble perforada de D=50 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble perforada de D=50 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble perforada de D=50 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


)
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)




(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_PD Perf 100")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sumpdp100 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_PD Perf 100: ")
         (princ (rtos sumpdp100))

(setq b (+ 0.1 0.6))
(setq h (+ 0.1 0.5))
(setq vgi (* b h))
(setq vcai (* 0.1 b))
(setq vri (* 0.2 b))
(setq vexi (+ vgi vcai))
(setq vexi (+ vexi vri))
(setq vg (+ vg vgi))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
      
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumpdp100 2 0) "M tubería de HDPE de pared doble perforada de D=100 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vgi 2 2) "M3  volumen de grava por tubería de HDPE de pared doble perforada de D=100 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble perforada de D=100 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble perforada de D=100 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble perforada de D=100 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))




)
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)







(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_PD Perf 200")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sumpdp200 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_PD Perf 200: ")
         (princ (rtos sumpdp200))

(setq b (+ 0.2 0.6))
(setq h (+ 0.2 0.5))
(setq vgi (* b h))
(setq vcai (* 0.1 b))
(setq vri (* 0.2 b))
(setq vexi (+ vgi vcai))
(setq vexi (+ vexi vri))
(setq vg (+ vg vgi))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
     
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumpdp200 2 0) "M tubería de HDPE de pared doble perforada de D=200 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vgi 2 2) "M3  volumen de grava por tubería de HDPE de pared doble perforada de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble perforada de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble perforada de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble perforada de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))



 )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_PD Nperf 200")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sumNpdp200 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_PD Nperf 200: ")
         (princ (rtos sumNpdp200))

(setq b (+ 0.2 0.6))
(setq h (+ 0.4 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
     
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumNpdp200 2 0) "M tubería de HDPE de pared doble no perforada de D=200 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble no perforada de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble no perforada de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble no perforada de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


 )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_PD Perf 300")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sumpdp300 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_PD perf 300: ")
         (princ (rtos sumpdp300))

(setq b (+ 0.3 0.6))
(setq h (+ 0.3 0.5))
(setq vgi (* b h))
(setq vcai (* 0.1 b))
(setq vri (* 0.2 b))
(setq vexi (+ vgi vcai))
(setq vexi (+ vexi vri))
(setq vg (+ vg vgi))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
     
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumpdp300 2 0) "M tubería de HDPE de pared doble perforada de D=300 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vgi 2 2) "M3  volumen de grava por tubería de HDPE de pared doble perforada de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble perforada de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble perforada de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble perforada de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))



 )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)



(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_PD Nperf 300")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sumNpdp300 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_PD Nperf 300: ")
         (princ (rtos sumNpdp300))
      
(setq b (+ 0.3 0.6))
(setq h (+ 0.5 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumNpdp300 2 0) "M tubería de HDPE de pared doble no perforada de D=300 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble no perforada de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble no perforada de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble no perforada de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


)
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_PD Perf 450")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sumpdp450 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_PD Perf 450: ")
         (princ (rtos sumpdp450))

(setq b (+ 0.45 0.6))
(setq h (+ 0.45 0.5))
(setq vgi (* b h))
(setq vcai (* 0.1 b))
(setq vri (* 0.2 b))
(setq vexi (+ vgi vcai))
(setq vexi (+ vexi vri))
(setq vg (+ vg vgi))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
    
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumpdp450 2 0) "M tubería de HDPE de pared doble perforada de D=450 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vgi 2 2) "M3  volumen de grava por tubería de HDPE de pared doble perforada de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble perforada de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble perforada de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble perforada de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


  )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)



(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_PD Nperf 450")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sumNpdp450 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_PD NPerf 450: ")
         (princ (rtos sumNpdp450))

(setq b (+ 0.45 0.6))
(setq h (+ 0.65 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
      
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumNpdp450 2 0) "M tubería de HDPE de pared doble no perforada de D=450 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble no perforada de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble no perforada de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble no perforada de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


)
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)

(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_PD Perf 600")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sumpdp600 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_PD Perf 600: ")
         (princ (rtos sumpdp600))


(setq b (+ 0.6 0.6))
(setq h (+ 0.6 0.5))
(setq vgi (* b h))
(setq vcai (* 0.1 b))
(setq vri (* 0.2 b))
(setq vexi (+ vgi vcai))
(setq vexi (+ vexi vri))
(setq vg (+ vg vgi))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
      

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumpdp600 2 0) "M tubería de HDPE de pared doble perforada de D=600 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vgi 2 2) "M3  volumen de grava por tubería de HDPE de pared doble perforada de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble perforada de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble perforada de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble perforada de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


)
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_PD Nperf 600")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sumNpdp600 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_PD Nperf 600: ")
         (princ (rtos sumNpdp600))

(setq b (+ 0.6 0.6))
(setq h (+ 0.8 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
     
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumNpdp600 2 0) "M tubería de HDPE de pared doble no perforada de D=600 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble no perforada de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble no perforada de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble no perforada de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


 )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR15 50")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum1550 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR15 50: ")
         (princ (rtos sum1550))

(setq b (+ 0.05 0.6))
(setq h (+ 0.25 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
    
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum1550 2 0) "M tubería de HDPE sólida SDR 15 de D=50 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 15 de D=50 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 15 de D=50 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 15 de D=50 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))



 )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR17 200")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum17200 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR17 200: ")
         (princ (rtos sum17200))

(setq b (+ 0.2 0.6))
(setq h (+ 0.40 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))

     
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum17200 2 0) "M tubería de HDPE sólida SDR 17 de D=200 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 17 de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 17 de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 17 de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


 )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR17 300")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum17300 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR17 300: ")
         (princ (rtos sum17300))

(setq b (+ 0.3 0.6))
(setq h (+ 0.5 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
      

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum17300 2 0) "M tubería de HDPE sólida SDR 17 de D=300 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 17 de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 17 de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 17 de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))



)
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR17 450")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum17450 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR17 450: ")
         (princ (rtos sum17450))

(setq b (+ 0.45 0.6))
(setq h (+ 0.65 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum17450 2 0) "M tubería de HDPE sólida SDR 17 de D=450 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 17 de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 17 de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 17 de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))



 )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)



(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR17 600")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum17600 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR17 600: ")
         (princ (rtos sum17600))

(setq b (+ 0.6 0.6))
(setq h (+ 0.8 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
     
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum17600 2 0) "M tubería de HDPE sólida SDR 17 de D=600 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 17 de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 17 de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 17 de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


 )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)




(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR21 200")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum21200 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR21 200: ")
         (princ (rtos sum21200))

(setq b (+ 0.2 0.6))
(setq h (+ 0.4 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
     
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum21200 2 0) "M tubería de HDPE sólida SDR 21 de D=200 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 21 de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 21 de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 21 de D=200 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


 )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR21 300")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum21300 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR21 300: ")
         (princ (rtos sum21300))

(setq b (+ 0.2 0.6))
(setq h (+ 0.4 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
    

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum21300 2 0) "M tubería de HDPE sólida SDR 21 de D=300 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 21 de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 21 de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 21 de D=300 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))



  )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR21 450")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum21450 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR21 450: ")
         (princ (rtos sum21450))

(setq b (+ 0.45 0.6))
(setq h (+ 0.65 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
      
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum21450 2 0) "M tubería de HDPE sólida SDR 21 de D=450 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 21 de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 21 de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 21 de D=450 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))



)
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)



(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR21 600")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum21600 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR21 600: ")
         (princ (rtos sum21600))

(setq b (+ 0.6 0.6))
(setq h (+ 0.85 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
      
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum21600 2 0) "M tubería de HDPE sólida SDR 21 de D=600 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 21 de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 21 de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 21 de D=600 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))




)
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)

(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR21 750")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum21750 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR21 750: ")
         (princ (rtos sum21750))


(setq b (+ 0.75 0.6))
(setq h (+ 0.95 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))
      
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum21750 2 0) "M tubería de HDPE sólida SDR 21 de D=750 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 21 de D=750 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 21 de D=750 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 21 de D=750 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


)
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(setq p  (ssget  "X" (list (cons -4 "<or")
                              (cons 0 "LINE")
                              (cons 0 "LWPOLYLINE")
                              (cons -4 "<and")
                                 (cons 0 "POLYLINE")
                                 (cons -4 "<not")
                                    (cons -4 "&") (cons 70 (+ 16 32 64))
                                 (cons -4 "not>")
                              (cons -4 "and>")
                           (cons -4 "or>") (cons 8 "AA T_S SDR21 900")
                     )
            )
         sum1 0.0
         sum2 0.0
         sum3 0.0
   )
   ;check for null selection set
   (if p
      (progn
         (setq l 0)
         (repeat (sslength p)
            (cond
               ((= "LINE" (cdr (assoc 0 (setq e (entget (ssname p l))))))
                  (setq sxy (cdr (assoc 10 e))
                        exy (cdr (assoc 11 e))
                        sum1 (+ sum1 (distance sxy exy))
                  )
                  (terpri)
               )
               ((= "LWPOLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
               ((= "POLYLINE" (cdr (assoc 0 (entget (setq e (ssname p l))))))
                  (command "_.area" "_E" e)
                  (setq sum2 (+ sum2 (getvar "perimeter")))
                  (terpri)
               )
            )
            (setq l (1+ l))
         )
         (setq sum21900 (+ sum1 sum2))
                 (princ (rtos sum2))
         (princ "\nLa suma total de longitudes para lineas y/o polilineas es AA T_S SDR21 900: ")
         (princ (rtos sum21900))


(setq b (+ 0.90 0.6))
(setq h (+ 1.10 0.5))
(setq vcai (* 0.1 b))
(setq vri (* h b))
(setq vexi (+ vri vcai))
(setq vca (+ vca vcai))
(setq vr (+ vr vri))
(setq vex (+ vex vexi))

     
(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sum21900 2 0) "M tubería de HDPE sólida SDR 21 de D=900 mm:") )

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE sólida SDR 21 de D=900 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE sólida SDR 21 de D=900 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE sólida SDR 21 de D=900 mm:"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))


 )
      
(princ "\nNo has seleccionado ninguna linea o polilinea") 
   )
   (princ)


(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vca 2 2) "M3  volumen total de cama de arena"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vr 2 2) "M3  volumen total de relleno estructural"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vex 2 2) "M3  volumen total de excavación de zanja"))       

(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
)

 

Thanks everyone for your help

Edwin Saez


LinkedIn / AutoCAD Certified Professional


EESignature


 


Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.

0 Likes
Accepted solutions (1)
2,675 Views
30 Replies
Replies (30)
Message 2 of 31

Edwin.Saez
Advisor
Advisor

Someone could help me with this, it is to add a selection to the lines of which I want the amounts of lengths and that the obtained data come out in a table. Please help

Edwin Saez


LinkedIn / AutoCAD Certified Professional


EESignature


 


Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.

0 Likes
Message 3 of 31

dlanorh
Advisor
Advisor

Patience is a virtue.

You are also not subtracting the area of the pipe from the area of gravel, and your volumes are not volumes but areas, and they need to be multiplied by the length of each pipe.

Once this is complete everything needs to be converted and put into a table, and each table then inserted into the drawing. It all takes time.

I am not one of the robots you're looking for

0 Likes
Message 4 of 31

dbhunia
Advisor
Advisor

check the attached Lisp........(it will create TABLE only for Tube 50 & 100)

 

I made some addition only for two set of Tube (50 & 100)...... you add for rest

 

.......
;(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumpdp50 2 0) "M  tubería de HDPE de pared doble perforada de D=50 mm:"))       
(setq Text_List (cons (list "tubería de HDPE de pared doble perforada de D=50 mm" (rtos sumpdp50 2 0) "m") Text_List))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

;(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vgi 2 2) "M3  volumen de grava por tubería de HDPE de pared doble perforada de D=50 mm:"))       
(setq Text_List (cons (list "volumen de grava por tubería de HDPE de pared doble perforada de D=50 mm" (rtos vgi 2 2) "m3") Text_List))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

;(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble perforada de D=50 mm:"))       
(setq Text_List (cons (list "volumen de cama de arena por tubería de HDPE de pared doble perforada de D=50 mm" (rtos vcai 2 2) "m3") Text_List))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

;(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble perforada de D=50 mm:"))       
(setq Text_List (cons (list "volumen de relleno estructural por tubería de HDPE de pared doble perforada de D=50 mm" (rtos vri 2 2) "m3") Text_List))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

;(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble perforada de D=50 mm:"))       
(setq Text_List (cons (list "volumen de excavación de zanja por tubería de HDPE de pared doble perforada de D=50 mm" (rtos vexi 2 2) "m3") Text_List))
(setq Text_List (cons (list " " " " " ") Text_List))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
......
.......
.......
;(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos sumpdp100 2 0) "M tubería de HDPE de pared doble perforada de D=100 mm:") )
(setq Text_List (cons (list "tubería de HDPE de pared doble perforada de D=100 mm" (rtos sumpdp100 2 0) "m") Text_List))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

;(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vgi 2 2) "M3  volumen de grava por tubería de HDPE de pared doble perforada de D=100 mm:"))       
(setq Text_List (cons (list "volumen de grava por tubería de HDPE de pared doble perforada de D=100 mm:" (rtos vgi 2 2) "m3") Text_List))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

;(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vcai 2 2) "M3  volumen de cama de arena por tubería de HDPE de pared doble perforada de D=100 mm:"))       
(setq Text_List (cons (list "volumen de cama de arena por tubería de HDPE de pared doble perforada de D=100 mm:" (rtos vcai 2 2) "m3") Text_List))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

;(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vri 2 2) "M3  volumen de relleno estructural por tubería de HDPE de pared doble perforada de D=100 mm:"))       
(setq Text_List (cons (list "volumen de relleno estructural por tubería de HDPE de pared doble perforada de D=100 mm:" (rtos vri 2 2) "m3") Text_List))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))

;(command "_text" "j" "c" pick_pt_orig 3.75 0 (strcat  (rtos vexi 2 2) "M3  volumen de excavación de zanja por tubería de HDPE de pared doble perforada de D=100 mm:"))       
(setq Text_List (cons (list "volumen de excavación de zanja por tubería de HDPE de pared doble perforada de D=100 mm:" (rtos vexi 2 2) "m3") Text_List))
(setq Text_List (cons (list " " " " " ") Text_List))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
;(setq pick_pt_orig (mapcar '- pick_pt_orig (list 0 10)))
.......

Hopefully you can manage the rest.......

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 5 of 31

Sea-Haven
Mentor
Mentor

Your making life difficult for your self in your coding it would be far better to create some defuns and loop through a list of layers or layers that are selected in some way. You have a repeating pattern so its not that hard.

 

This is your layer portion (cons 8 "AA T_PD Perf 50") needed in the repeat

0 Likes
Message 6 of 31

dlanorh
Advisor
Advisor

Attached are your test drawing with notes, and the new lisp.

 

This is still automated and will check every layer. I did notice that there is no layer "AA T_S SDR?? 100", should there be?

The lisp will loop through all the supplied layers, calculated the volumes (subtracting the pipe volume from the gravel/structural fill volume as appropriate)

 

Only layers with line work will be processed (see drawing)

 

Let me know your thoughts

 

I am not one of the robots you're looking for

0 Likes
Message 7 of 31

Edwin.Saez
Advisor
Advisor

@dlanorh ,

Thanks for your help, I got to test the lisp inside the file you sent, and inside if the lisp worked. I tried to try it inside another dwg and I get the following error, and just insert a single empty table.

 

Command: SUMLP
Punto de Insercion de Salida de datos :
La suma total de longitudes para lineas y/o polilineas es AA T_PD Perf 50 : 4775; error: AutoCAD.Applicati
on: Key not found

*doing some tests within the dwg that you sent, I realized that when there are no pipes of the "AA T_PD Perf 50" layer, the same place the table with quantities "0 m3" (the lisp should recognize that there are no pipes of that layer and not place the table that corresponds).

*about what you asked me, if there should be a cape for "AA T_S SDR 100"

*I have a question, what section are you assuming for the calculation of the other elements?

 

Edwin Saez


LinkedIn / AutoCAD Certified Professional


EESignature


 


Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.

0 Likes
Message 8 of 31

dlanorh
Advisor
Advisor

I have updated the lisp to address the errors (attached) and also attached a drawing of the sections I constructed based on my best guess interpretation of the variables

I am not one of the robots you're looking for

0 Likes
Message 9 of 31

Edwin.Saez
Advisor
Advisor

@dlanorh ,

I still have the same error when executing the lisp in another dwg

Command: SUMLP
Punto de Insercion de Salida de datos :
La suma total de longitudes para lineas y/o polilineas es AA T_PD Perf 100 : 4775 m; error: AutoCAD.Application: Key not found

*  I think you mistakenly attached the same initial lisp that you sent me

Edwin Saez


LinkedIn / AutoCAD Certified Professional


EESignature


 


Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.

0 Likes
Message 10 of 31

Edwin.Saez
Advisor
Advisor

@dlanorh,

  I think you mistakenly attached the same initial lisp that you sent me

Edwin Saez


LinkedIn / AutoCAD Certified Professional


EESignature


 


Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.

0 Likes
Message 11 of 31

dlanorh
Advisor
Advisor

Attached is the latest lisp. I have solved the table problem and the text display problem.

 

The lisp searches the layer table to see if a layer exists. If it doesn't it moves to the next layer.

 

The lisp then searches the layer for any lines or polylines. If it finds nothing it goes to the next layer.

 

If the message :

 

La suma total de longitudes para lineas y/o polilineas es AA T_PD Perf 50

 appears, there is a line or polyline on that layer. If it is a very short line or polyline, when the table is inserted it will show the calculations based on this very short distance, and as they are rounded, it is likely that the volume or distance will show as 0 or 0.00.

 

This error : "error: AutoCAD.Application: Key not found" can occur for a multitude of reasons, one being that the layer is not in the drawing, however I am checking for this, and on my system (2012) if the layer is not there it returns nil, and doesn't generate an error.

 

Another reason could be that you are running a windows with a different local language and there is an incompatibility somewhere, so please check the text. Also be aware of any lines/polylines in layers in legends.

 

 

 

 

I am not one of the robots you're looking for

Message 12 of 31

Edwin.Saez
Advisor
Advisor

@dlanorh ,

thanks for the time you are taking to help me. 🤗

 

Something strange is happening, the error I sent you generates me in a new dwg, but when I execute the lisp inside the original test file the lisp works very well. I attached a dwg where you have all the information inside that contained the original dwg that I sent you, just copy everything inside a new dwg, but in this new dwg the error that mentions you is generated. Maybe if you try the lisp within this new dwg, it will generate the same error that is happening to me.

 

* I will also tell you that I am using autocad 2018 English version.

* I attached another dwg, where I send you a typical section of the trench, I would be very grateful to include in the lisp that the cut of the trench can be included as a data that the user defines at the time of using the lisp, this slope of cut would be the data.
* Something that I forget to tell you, is that not always a Perf pipe will have gravel and structural filling, so this could be included in the lisp to allow you to choose whether it will have only gravel or gravel and structural filling. In the case of NPerf and SDR pipes, if they are only going to have structural filling.

I know it's a bit long, and in the end it will look great. I appreciate your time again for helping me with this, thank you very much!

 

 

Edwin Saez


LinkedIn / AutoCAD Certified Professional


EESignature


 


Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.

0 Likes
Message 13 of 31

dlanorh
Advisor
Advisor

I am generating the same error in a new drawing. It is happening when the lisp is run. I shall investigate.

 

How do you typically enter enter a slope? 1 in , % angle or something other?

I am not one of the robots you're looking for

0 Likes
Message 14 of 31

dlanorh
Advisor
Advisor

I think I've pinpointed the error, it was a logic error in my programming where i was sending the a nil list to the table function, because it was not in the correct place in the code. I have corrected this and added an exit statement if no lines or polylines are found on the required error.

 

The attached lisp now works in a blank template drawing of mine.

 

Updated lisp attached.

I am not one of the robots you're looking for

0 Likes
Message 15 of 31

Edwin.Saez
Advisor
Advisor

@dlanorh ,

the slope of the trench will always be 1 in the vertical and will change in the horizontal, being the most common 0.2, 0.5, 0.75, 1. Example:
0.5: 1 (0.5 units in the horizontal and 1 unit in the vertical)
2: 1 (2 units in the horizontal and 1 unit in the vertical)

 

slope.png

Edwin Saez


LinkedIn / AutoCAD Certified Professional


EESignature


 


Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.

0 Likes
Message 16 of 31

dlanorh
Advisor
Advisor
Will this trench profile also affect solid & Nperf?

I am not one of the robots you're looking for

0 Likes
Message 17 of 31

Edwin.Saez
Advisor
Advisor

@dlanorh ,

That's right, it will always be for all types (Perf, NPerf, Solid)

Edwin Saez


LinkedIn / AutoCAD Certified Professional


EESignature


 


Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.

0 Likes
Message 18 of 31

Edwin.Saez
Advisor
Advisor

@dlanorh ,

It is true that in an empty dwg file the lisp does not perform any action. but when reloading the lisp into a dwg that contains the pipes, this again shows another error, maybe you can check it again because it could be another logical error like the one you mentioned earlier.

La suma total de longitudes para lineas y/o polilineas es AA T_PD Perf 50 : 48 43. 848 253 m
Oops an Error : AutoCAD.Application: Key not found occurred

thanks for everything 

Edwin Saez


LinkedIn / AutoCAD Certified Professional


EESignature


 


Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.

0 Likes
Message 19 of 31

dlanorh
Advisor
Advisor

@Edwin.Saez wrote:

@dlanorh ,

It is true that in an empty dwg file the lisp does not perform any action. but when reloading the lisp into a dwg that contains the pipes, this again shows another error, maybe you can check it again because it could be another logical error like the one you mentioned earlier.

La suma total de longitudes para lineas y/o polilineas es AA T_PD Perf 50 : 48 43. 848 253 m
Oops an Error : AutoCAD.Application: Key not found occurred

thanks for everything 


This error occurs when the incorrect table style is current. This is corrected in the completed lisp by setting the correct table style current, provided it is in the drawing.

 

I have completed the lisp and I am in the process of testing it in all circumstances. I would however like to check the profiles again. See attached drawing. In particular the Nperf and solid and the value of H.

 

H = pipe size + 0.5 Perf without cap & + 0.2 with cap

H = pipe size + 0.7 Nperf & Solid

I am not one of the robots you're looking for

0 Likes
Message 20 of 31

Edwin.Saez
Advisor
Advisor

@dlanorh ,

The measures indicated in the dwg are correct. However, keep in mind that the "B" and the "H" will change depending on the diameter of the pipe used. I show you in the following image a table where you can see how they vary depending on the pipe diameter.

 

tuberias.png

thanks @dlanorh 

Edwin Saez


LinkedIn / AutoCAD Certified Professional


EESignature


 


Si mi respuesta fue una solución para usted, por favor seleccione "Aceptar Solución", para que también sirva a otro usuarios.

0 Likes