SlideShare a Scribd company logo
1 of 13
; Realizado por: Ing. Napoleón Zambrano Figueroa
; Fecha: desde 2003 en adelante
; Guardar como procesos.lsp
(defun c:d2d()
(setq pto1 (getpoint "Punto 1:")) (terpri)
(setq pto2 (getpoint pto1 "Punto 2:")) (terpri)
(setq x1 (car pto1))
(setq x2 (car pto2))
(setq y1 (car (cdr pto1)))
(setq y2 (car (cdr pto2)))
(setq dl (sqrt (+ (* (- x2 x1) (- x2 x1)) (* (- y2 y1) (- y2 y1)))))
(print "Distancia 2D: ")
(prin1 dl)
(prin1)
)
(defun c:cota()
(setq ht (getreal "Altura de texto: ")) (terpri)
(setq var_osnap -1)
(while (= var_osnap -1)
(setq var_osnap (getint "[0]-End Point [1]-Node [2]-Inserción [3]-None:
"))
(cond
((= var_osnap 0)
(setq var_osnap 1)
)
((= var_osnap 1)
(setq var_osnap 8)
)
((= var_osnap 2)
(setq var_osnap 64)
)
((= var_osnap 3)
(setq var_osnap 0)
)
(setq var_osnap -1)
)
)
(setq osnap_on var_osnap)
(setq osnap_of (+ var_osnap 16584))
(setq pto (list 0 0 0))
(while (/= pto nil)
(command "_setvar" "osmode" osnap_on)
(setq pto (getpoint "Punto de cota: ")) (terpri)
(if (/= pto nil)
(progn
(setq x (+ (car pto) (/ ht 2.)))
(setq y (+ (cadr pto) (/ ht 2.)))
(setq z (caddr pto))
(setq pto1 (list x y z))
(setq txt_z (rtos z 2 3))
(setq txt_z (strcat " + " txt_z))
(command "_setvar" "osmode" osnap_of)
(command "_text" pto1 ht "0" txt_z)
(command "_point" pto)
)
)
)
)
(defun c:HPto()
(setq ht (getreal "Altura de texto: ")) (terpri)
(setq aa (getint "Número de decimales: ")) (terpri)
(setq var_osnap -1)
(while (= var_osnap -1)
(setq var_osnap (getint "[0]-End Point [1]-Node [2]-Inserción [3]-None:
"))
(cond
((= var_osnap 0)
(setq var_osnap 1)
)
((= var_osnap 1)
(setq var_osnap 8)
)
((= var_osnap 2)
(setq var_osnap 64)
)
((= var_osnap 3)
(setq var_osnap 0)
)
(setq var_osnap -1)
)
)
(setq osnap_on var_osnap)
(setq osnap_of (+ var_osnap 16584))
(setq pto (list 0 0 0))
(while (/= pto nil)
(command "_setvar" "osmode" osnap_on)
(setq pto (getpoint "Punto de cota: ")) (terpri)
(if (/= pto nil)
(progn
(setq x (+ (car pto) (/ ht 2.)))
(setq y (+ (cadr pto) (/ ht 2.)))
(setq z (caddr pto))
(setq pto1 (list x y z))
(setq txt_z (rtos z 2 aa))
(command "_setvar" "osmode" osnap_of)
(command "_text" pto1 ht "0" txt_z)
)
)
)
)
(defun c:Coord()
(setq arch_txt (getstring "Archivo de Datos: ")) (terpri)
(setq archin (open arch_txt "W"))
(setq ht (getreal "Altura de texto: ")) (terpri)
(setq dht (/ ht 2))
(setq var_osnap -1)
(while (= var_osnap -1)
(setq var_osnap (getint "[0]-End Point [1]-Node [2]-Centro [3]-None: "))
(cond
((= var_osnap 0)
(setq var_osnap 1)
)
((= var_osnap 1)
(setq var_osnap 8)
)
((= var_osnap 2)
(setq var_osnap 4)
)
((= var_osnap 3)
(setq var_osnap 0)
)
(setq var_osnap 0)
)
)
(setq osnap_on var_osnap)
(setq osnap_of (+ var_osnap 16584))
(setq pto (list 0 0 0))
(while (/= pto nil)
(command "_setvar" "osmode" osnap_on)
(setq pto (getpoint "Punto de cota: ")) (terpri)
(if (/= pto nil)
(progn
(setq x (car pto) y (cadr pto) z (caddr pto))
(setq txt_N (strcat "N-" (rtos y 2 2) " ") txt_E (strcat "E-" (rtos x 2
2) " "))
(setq ptoN (list (+ x dht) (+ y dht)) ptoE (list (- x dht) (+ y dht)))
(command "_setvar" "osmode" osnap_of)
(command "_text" ptoN ht "0" txt_N)
(command "_text" ptoE ht "90" txt_E)
(setq txt_archin (strcat (rtos y 2 2) ";" (rtos x 2 2) ";" (rtos z 2 3)))
(print txt_archin archin)
)
)
)
(close archin)
)
;
; INICIO PROGRAMA CURVAS PARA LWPOLILINEAS
;
(defun c:curvas()
(setvar attrec 1)
(setvar attdia 0)
(setq arch_txt (getstring "Archivo de Datos: ")) (terpri)
(setq archin (open arch_txt "W"))
(setq txt_archin "ang ; x1 ; y1 ; x2 ; y2 ; x3 ; y3 ; Tan ; R ; L ; C")
(print txt_archin archin)
(setq alin_cod (entsel "Seleccione la LWPolilyne: ")) (Terpri)
(setq ht (getreal "Altura de textos: ")) (Terpri)
(setq alin_cod (car alin_cod))
(setq entid (entget alin_cod))
(setq cord_lst (list '(ini) ))
(setq lst42 (list '(ini) ))
(setq n 1 nl 0)
(command "_setvar" "osmode" 0)
(while (< n (length entid))
(setq elis (nth n entid))
(setq id_elis (car elis))
(cond
((= id_elis 10)
(setq nl (+ nl 1))
(setq cord_lst (append cord_lst (list elis)))
)
((= id_elis 42)
(setq lst42 (append lst42 (list elis)))
)
)
(setq n (+ n 1))
)
(setq cord_lst (append cord_lst (list '(fin))))
(setq lst42 (append lst42 (list '(fin))))
(print cord_lst)
(print lst42)
(setq nelem (length cord_lst) pivot 2 vert 0 curva 0 ctrol t)
(setq pto1 (cdr (nth 1 cord_lst)) pto2 (nth 2 cord_lst) pto3 (nth 3 cord_lst))
(while (/= (car pto3) 'FIN)
(print pto3)
(setq pto2 (cdr pto2))
(setq pto3 (cdr pto3))
(setq tipo (cdr (nth pivot lst42)))
(setq x1 (car pto1) y1 (cadr pto1))
(setq x2 (car pto2) y2 (cadr pto2))
(setq x3 (car pto3) y3 (cadr pto3))
(if (= tipo 0)
(progn ;Vertice
(setq vert (+ vert 1))
(setq ang1 (angle pto1 pto2) ang2 (angle pto2 pto3))
(setq ang (- ang2 ang1))
(setq ang (abs ang))
(cond
((> ang (* 1.5 pi))
(setq ang (- (* 2. pi) ang))
)
((> ang pi)
(setq ang (- ang pi))
)
)
(setq ang_txt (angtos ang 1 4))
(command "_insert" "PI-Alfa" pto2 ht ht "0" ang_txt vert)
(setq txt_archin (strcat (rtos ang 2 8) ";" (rtos x1 2 2) ";" (rtos y1 2
2) ";" (rtos x2 2 2) ";" (rtos y2 2 2) ";" (rtos x3 2 3) ";" (rtos y3 2 2)))
(print txt_archin archin)
(setq pto1 pto2 pivot (+ pivot 1))
)
(progn ;Arco
(setq curva (+ curva 1))
(setq pto4 (nth (+ pivot 2) cord_lst))
(setq pto4 (cdr pto4))
(setq ang1 (angle pto1 pto2) ang2 (angle pto3 pto4))
(setq ang (- ang2 ang1))
(setq ang (abs ang))
(cond
((> ang (* 1.5 pi))
(setq ang (- (* 2. pi) ang))
)
((> ang pi)
(setq ang (- ang pi))
)
)
(setq ang_txt (angtos ang 1 4))
(setq pto5 (inters pto1 pto2 pto3 pto4 nil))
(setq Tan (distance pto2 pto5))
(setq ang_2 (/ ang 2.))
(setq R (/ (* Tan (cos ang_2)) (sin ang_2)))
(setq L (* R ang))
(setq C (distance pto2 pto3))
(setq txt_R (rtos R 2 2) txt_Tan (rtos Tan 2 2) txt_L (rtos L 2 2) txt_C
(rtos C 2 2))
(command "_insert" "Curva" pto5 ht ht "0" txt_R txt_Tan txt_L txt_C
ang_txt curva)
(command "_Pline" pto2 pto5 pto3 "")
(setq txt_archin (strcat (rtos ang 2 8) ";" (rtos x1 2 2) ";" (rtos y1 2
2) ";" (rtos x2 2 2) ";" (rtos y2 2 2) ";" (rtos x3 2 3) ";" (rtos y3 2 2) ";"
(rtos Tan 2 4) ";" (rtos R 2 4) ";" (rtos L 2 4) ";"
(rtos C 2 4) ";"))
(print txt_archin archin)
(setq pto1 pto3 pivot (+ pivot 2))
)
)
(setq pto2 (nth pivot cord_lst))
(setq pto3 (nth (+ pivot 1) cord_lst))
)
(close archin)
(setvar attdia 1)
)
;
; FIN PROGRAMA CURVAS PARA LWPOLILINEAS
;
;
; INICIO PROGRAMA CURVAS PARA POLILINEAS
;
(defun c:plcur()
(setq arch_txt "d:/tmp/plcur.txt") (terpri)
(setq archin (open arch_txt "W"))
;(print "No.,R,alfa,T,L,C" archin)
(setq txt_archin "ang ; x1 ; y1 ; x2 ; y2 ; x3 ; y3 ; Tan ; R ; L ; C")
(print txt_archin archin)
(setq alin_cod (entsel "Seleccione la Polilyne: ")) (Terpri)
(setq ht (getreal "Altura de textos: ")) (Terpri)
(setq alin_cod (car alin_cod))
(setq entid (entget alin_cod))
(setq cord_lst (list '(ini) ))
(setq lst42 (list '(ini) ))
(setq n 1 nl 0)
(command "_setvar" "osmode" 0)
(setq alin_cod (entnext alin_cod))
(setq entid (entget alin_cod))
(setq ctrol1 (cdr (assoc 0 entid)))
(while (= ctrol1 "VERTEX")
(setq elis (assoc 10 entid))
(setq id_elis (assoc 42 entid))
(setq nl (+ nl 1))
(setq cord_lst (append cord_lst (list elis)))
(setq lst42 (append lst42 (list id_elis)))
(setq n (+ n 1))
(setq alin_cod (entnext alin_cod))
(setq entid (entget alin_cod))
(setq ctrol1 (cdr (assoc 0 entid)))
)
(setq cord_lst (append cord_lst (list '(fin))))
(setq lst42 (append lst42 (list '(fin))))
(print cord_lst)
(print lst42)
(setq nelem (length cord_lst) pivot 2 vert 0 curva 0 ctrol t)
(setq pto1 (cdr (nth 1 cord_lst)) pto2 (nth 2 cord_lst) pto3 (nth 3 cord_lst))
(while (/= (car pto3) 'FIN)
(print pto3)
(setq pto2 (cdr pto2))
(setq pto3 (cdr pto3))
(setq tipo (cdr (nth pivot lst42)))
(setq x1 (car pto1) y1 (cadr pto1))
(setq x2 (car pto2) y2 (cadr pto2))
(setq x3 (car pto3) y3 (cadr pto3))
(cond
((and (= x1 x2) (= y1 y2))
(setq pto1 pto2 pivot (+ pivot 1))
)
((= tipo 0) ;Vertice
(setq vert (+ vert 1))
(setq ang1 (angle pto1 pto2) ang2 (angle pto2 pto3))
(setq ang (- ang2 ang1))
(setq ang (abs ang))
(cond
((> ang (* 1.5 pi))
(setq ang (- (* 2. pi) ang))
)
((> ang pi)
(setq ang (- ang pi))
)
)
(setq ang_txt (angtos ang 1 4))
(command "_insert" "PI-Alfa" pto2 ht ht "0" ang_txt vert)
(setq pto1 pto2 pivot (+ pivot 1))
(setq txt_archin (strcat (rtos ang 2 8) ";" (rtos x1 2 2) ";" (rtos y1 2 2)
";" (rtos x2 2 2) ";" (rtos y2 2 2) ";" (rtos x3 2 3) ";" (rtos y3 2 2)))
(print txt_archin archin)
)
(progn ;Arco
(setq curva (+ curva 1))
(setq pto4 (nth (+ pivot 2) cord_lst))
(setq pto4 (cdr pto4))
(setq ang1 (angle pto1 pto2) ang2 (angle pto3 pto4))
(setq ang (- ang2 ang1))
(setq ang (abs ang))
(cond
((> ang (* 1.5 pi))
(setq ang (- (* 2. pi) ang))
)
((> ang pi)
(setq ang (- ang pi))
)
)
(setq ang_txt (angtos ang 1 4))
(setq pto5 (inters pto1 pto2 pto3 pto4 nil))
(setq Tan (distance pto2 pto5))
(setq ang_2 (/ ang 2.))
(setq R (/ (* Tan (cos ang_2)) (sin ang_2)))
(setq L (* R ang))
(setq C (distance pto2 pto3))
(setq txt_R (rtos R 2 2) txt_Tan (rtos Tan 2 2) txt_L (rtos L 2 2) txt_C
(rtos C 2 2))
(command "_insert" "Curva" pto5 ht ht "0" txt_R txt_Tan txt_L txt_C ang_txt
curva)
(command "_Pline" pto2 pto5 pto3 "")
;(setq txt_arch (strcat (itoa curva) "," txt_R "," ang_txt "," txt_tan ","
txt_L "," txt_C))
;(print txt_arch archin)
(setq txt_archin (strcat (rtos ang 2 8) ";" (rtos x1 2 2) ";" (rtos y1 2 2)
";" (rtos x2 2 2) ";" (rtos y2 2 2) ";" (rtos x3 2 3) ";" (rtos y3 2 2) ";"
(rtos Tan 2 4) ";" (rtos R 2 4) ";" (rtos L 2 4) ";"
(rtos C 2 4) ";"))
(print txt_archin archin)
(setq pto1 pto3 pivot (+ pivot 2))
)
)
(setq pto2 (nth pivot cord_lst))
(setq pto3 (nth (+ pivot 1) cord_lst))
)
(close archin)
)
;
; FIN PROGRAMA CURVAS PARA POLILINEAS
;
(defun c:ExpEagle()
(setq arch_txt (getstring "Archivo de Datos: ")) (terpri)
(setq archin (open arch_txt "W"))
(setq pto1 (getpoint "Seleccione puntos: ")) (terpri)
(setq pto2 (getcorner pto1)) (terpri)
(setq ptos (list pto1 pto2))
(setq filtro (list (cons 0 "INSERT")))
(setq gr_ent (ssget "_W" pto1 pto2 filtro))
(setq num_ent (sslength gr_ent))
(setq n 0)
(print "inicia repeat:" )
(repeat num_ent
(setq ent_nom (ssname gr_ent n))
(setq ent (entget ent_nom))
(setq pto (cdr (assoc 10 ent)))
(setq Norte (cadr pto))
(setq Este (car pto))
(setq Elev (caddr pto))
(repeat 2
(setq ent_nom (entnext ent_nom))
(setq ent (entget ent_nom))
(setq ent_tipo (cdr (assoc 8 ent)))
(cond
((= ent_tipo "PNTNO")
(setq pto_num (cdr (assoc 1 ent)))
)
((= ent_tipo "PNTDES")
(setq Desc (cdr (assoc 1 ent)))
)
)
)
(setq txt_N (rtos Norte 2 3))
(setq txt_E (rtos Este 2 3))
(setq txt_Z (rtos Elev 2 3))
(setq texto (strcat pto_num "," txt_N "," txt_E "," txt_Z "," Desc))
(print texto archin)
(setq n (+ n 1))
)
(close archin)
)
(defun c:CtaLn()
(setq pto1 (getpoint "Seleccione puntos: ")) (terpri)
(setq pto2 (getcorner pto1)) (terpri)
(setq ptos (list pto1 pto2))
(setq capa (getstring "Nombre de capa: ")) (terpri)
(setq filtro (list (cons 0 "LINE") (cons 8 capa)))
(setq gr_ent (ssget "_C" pto1 pto2 filtro))
(setq tot_elem (sslength gr_ent))
(setq ne 0)
(setq ltub 0.)
(print "inicia repeat:" )
(repeat tot_elem
(setq vr_nom (ssname gr_ent ne))
(setq ln_car (entget vr_nom))
(setq pto1 (cdr (assoc 10 ln_car)))
(setq x1 (car pto1))
(setq y1 (car (cdr pto1)))
(setq z1 (car (cdr (cdr pto1))))
(setq pto1 (cdr (assoc 11 ln_car)))
(setq x2 (car pto1))
(setq y2 (car (cdr pto1)))
(setq z2 (car (cdr (cdr pto1))))
(setq lt (sqrt (+ (* (- x2 x1) (- x2 x1)) (* (- y2 y1) (- y2 y1)))))
(setq ltub (+ ltub lt) ne (+ ne 1))
)
(print "Numero de elementos: ")
(prin1 tot_elem)
(print "Longitud Total: ")
(prin1 ltub)
(print)
)
(defun c:numtxt()
(setq ht (getreal "Altura de texto: ")) (terpri)
(setq var_osnap -1)
(while (= var_osnap -1)
(setq var_osnap (getint "[0]-Punto final [1]-Nudo [2]-Ninguno: "))
(cond
((= var_osnap 0)
(setq var_osnap 1)
)
((= var_osnap 1)
(setq var_osnap 8)
)
((= var_osnap 2)
(setq var_osnap 0)
)
(setq var_osnap -1)
)
)
(setq incr (getreal "Número inicial: ")) (terpri)
(setq nxtn (getreal "Incremento: ")) (terpri)
(setq incr (- incr nxtn))
(setq osnap_on var_osnap)
(setq osnap_of (+ var_osnap 16584))
(setq pto (list 0 0 0))
(while (/= pto nil)
(command "_setvar" "osmode" osnap_on)
(setq pto (getpoint "Punto de inserción: ")) (terpri)
(if (/= pto nil)
(progn
(setq incr (+ incr nxtn))
(setq txt_incr (rtos incr 2 0))
(command "_setvar" "osmode" osnap_of)
(command "_text" pto ht "0" txt_incr)
)
)
)
)
(defun c:Norte()
(setq ht (getreal "Altura de texto: ")) (terpri)
(setq prec (getint "Precisión: ")) (terpri)
(setq dht (/ ht 2))
(setq var_osnap -1)
(while (= var_osnap -1)
(setq var_osnap (getint "[0]-End Point [1]-Node [2]-Intersección [3]-None:
"))
(cond
((= var_osnap 0)
(setq var_osnap 1)
)
((= var_osnap 1)
(setq var_osnap 8)
)
((= var_osnap 2)
(setq var_osnap 32)
)
((= var_osnap 3)
(setq var_osnap 0)
)
(setq var_osnap -1)
)
)
(setq osnap_on var_osnap)
(setq osnap_of (+ var_osnap 16584))
(setq pto (list 0 0 0))
(while (/= pto nil)
(command "_setvar" "osmode" osnap_on)
(setq pto (getpoint "Punto de cota: ")) (terpri)
(if (/= pto nil)
(progn
(setq x (car pto) y (cadr pto) z (caddr pto))
(setq txt_N (strcat "N-" (rtos y 2 prec) " ") txt_E (strcat "E-" (rtos x
2 prec) " "))
(setq ptoN (list (+ x dht) (+ y dht)) ptoE (list (- x dht) (+ y dht)))
(command "_setvar" "osmode" osnap_of)
(command "_text" ptoN ht "0" txt_N)
)
)
)
)
(defun c:Este()
(setq ht (getreal "Altura de texto: ")) (terpri)
(setq prec (getint "Precisi n: ")) (terpri)�
(setq dht (/ ht 2))
(setq var_osnap -1)
(while (= var_osnap -1)
(setq var_osnap (getint "[0]-End Point [1]-Node [2]-Intersecci n [3]-�
None: "))
(cond
((= var_osnap 0)
(setq var_osnap 1)
)
((= var_osnap 1)
(setq var_osnap 8)
)
((= var_osnap 2)
(setq var_osnap 32)
)
((= var_osnap 3)
(setq var_osnap 0)
)
(setq var_osnap -1)
)
)
(setq osnap_on var_osnap)
(setq osnap_of (+ var_osnap 16584))
(setq pto (list 0 0 0))
(while (/= pto nil)
(command "_setvar" "osmode" osnap_on)
(setq pto (getpoint "Punto de cota: ")) (terpri)
(if (/= pto nil)
(progn
(setq x (car pto) y (cadr pto) z (caddr pto))
(setq txt_N (strcat "N-" (rtos y 2 prec) " ") txt_E (strcat "E-" (rtos x
2 prec) " "))
(setq ptoN (list (+ x dht) (+ y dht)) ptoE (list (- x dht) (+ y dht)))
(command "_setvar" "osmode" osnap_of)
(command "_text" ptoE ht "90" txt_E)
)
)
)
)
; calcula areas
(defun c:Carea()
(setq arch_txt (getstring "Archivo de Datos: ")) (terpri)
(setq archin (open arch_txt "W"))
(print "#Area,Area,Perimetro" archin)
(setq ht (getreal "Altura de texto: ")) (terpri)
(setq incr (getint "N mero inicial: ")) (terpri)�
(setq nxtn (getint "Incremento: ")) (terpri)
(setq narea incr)
(setq ent (entsel "Seleccione Polilinea 2D: ")) (terpri)
(while (/= ent nil)
(setq longr 0.0)
(setq ent_nom (car ent))
(setq ent (entget ent_nom))
(setq lista ent)
(setq pto (assoc 10 ent))
(setq listx (list) listy (list) listc (list) listD (list))
(print "paso 0")
(while (/= pto nil)
(setq x1 (cadr pto))
(setq y1 (caddr pto))
(setq lx (list x1) ly (list y1))
(setq listx (append listx lx) listy (append listy ly))
(setq c_lista (assoc 42 lista))
(setq c (cdr c_lista))
(setq lista (cdr (member c_lista lista)))
(setq pto (assoc 10 lista))
(if (and (/= c 0) (/= pto nil))
(progn
(setq x2 (cadr pto))
(setq y2 (caddr pto))
(setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0))))
(setq lc (list c) lD (list D))
(setq listc (append listc lc) listD (append listD lD))
)
)
(if (and (/= c 0) (= pto nil))
(progn
(setq x2 (car listx))
(setq y2 (car listy))
(setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0))))
(setq lc (list c) lD (list D))
(setq listc (append listc lc) listD (append listD lD))
)
)
(if (= c 0)
(progn
(if (/= pto nil)
(progn
(setq x2 (cadr pto))
(setq y2 (caddr pto))
)
(progn
(setq x2 (car listx))
(setq y2 (car listy))
)
)
(setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0))))
(setq longr (+ longr D))
)
)
)
(print "paso 3")
(setq lx (list (car listx)) ly (list (car listy)))
(setq listx (append listx lx) listy (append listy ly))
(setq n 0 area 0.0)
(repeat (- (length listx) 1)
(setq x1 (nth n listx) y1 (nth n listy))
(setq x2 (nth (+ n 1) listx) y2 (nth (+ n 1) listy))
(setq area (+ area (- (* x1 y2) (* x2 y1))))
(setq n (+ n 1))
)
(print "paso 4")
(setq n 0 areac 0.0 longc 0.0)
(repeat (length listc)
(setq c (nth n listc) D (nth n listD))
(setq sig_c (/ c (abs c)) c (abs c))
(setq H (* D c 0.5))
(setq alfa (abs (- (* 2.0 pi) (* 4.0 (atan (/ 1.0 c))))))
(setq R (/ D (* 2.0 (sin (/ alfa 2.0)))))
(setq l_par (* (abs alfa) R))
(setq longc (+ longc l_par))
(setq a_par (* sig_c (- (* R R alfa 0.5) (* D 0.5 (- R H)))))
(setq areac (+ areac a_par))
(setq n (+ n 1))
)
(print "paso 5")
(setq area (+ (abs (/ area 2.0)) areac))
(setq perim (+ longr longc))
(print "paso 5.1")
(setq txt_narea (itoa narea))
(print "paso 5.2")
(setq txt_area (strcat "A=" (rtos area 2 2) "m2") narea (+ narea nxtn))
(setq txt_perim (strcat "P=" (rtos perim 2 2) "m"))
(setq txt_archin (strcat txt_narea "," (rtos area 2 3) "," (rtos perim 2
3) ))
(print txt_archin archin)
(setq ptoins (getpoint "Punto de inserci n de texto: ")) (terpri)�
(command "_text" ptoins ht 0 txt_narea)
(setq ent (entsel "Seleccione Polilinea 2D: ")) (terpri)
)
(close archin)
(print "Proceso finalizado sin problemas")
)
; calcula longitudes de lineas
(defun c:Clinea()
(setq arch_txt (getstring "Archivo de Datos: ")) (terpri)
(setq archin (open arch_txt "W"))
(print "#linea,Longitud" archin)
(setq ht (getreal "Altura de texto: ")) (terpri)
(setq incr (getint "N mero inicial: ")) (terpri)�
(setq nxtn (getint "Incremento: ")) (terpri)
(setq narea incr)
(setq ent (entsel "Seleccione Polilinea 2D: ")) (terpri)
(while (/= ent nil)
(setq longr 0.0)
(setq ent_nom (car ent))
(setq ent (entget ent_nom))
(setq lista ent)
(setq pto (assoc 10 ent))
(setq listx (list) listy (list) listc (list) listD (list))
(print "paso 0")
(while (/= pto nil)
(setq x1 (cadr pto))
(setq y1 (caddr pto))
(setq lx (list x1) ly (list y1))
(setq listx (append listx lx) listy (append listy ly))
(setq c_lista (assoc 42 lista))
(setq c (cdr c_lista))
(setq lista (cdr (member c_lista lista)))
(setq pto (assoc 10 lista))
(if (and (/= c 0) (/= pto nil))
(progn
(setq x2 (cadr pto))
(setq y2 (caddr pto))
(setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0))))
(setq lc (list c) lD (list D))
(setq listc (append listc lc) listD (append listD lD))
)
)
(if (and (/= c 0) (= pto nil))
(progn
(setq x2 (car listx))
(setq y2 (car listy))
(setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0))))
(setq lc (list c) lD (list D))
(setq listc (append listc lc) listD (append listD lD))
)
)
(if (= c 0)
(progn
(if (/= pto nil)
(progn
(setq x2 (cadr pto))
(setq y2 (caddr pto))
)
(progn
(setq x2 (car listx))
(setq y2 (car listy))
)
)
(setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0))))
(setq longr (+ longr D))
)
)
)
(print "paso 3")
(setq lx (list (car listx)) ly (list (car listy)))
(setq listx (append listx lx) listy (append listy ly))
(setq n 0 area 0.0)
(repeat (- (length listx) 1)
(setq x1 (nth n listx) y1 (nth n listy))
(setq x2 (nth (+ n 1) listx) y2 (nth (+ n 1) listy))
(setq area (+ area (- (* x1 y2) (* x2 y1))))
(setq n (+ n 1))
)
(print "paso 4")
(setq n 0 areac 0.0 longc 0.0)
(repeat (length listc)
(setq c (nth n listc) D (nth n listD))
(setq sig_c (/ c (abs c)) c (abs c))
(setq H (* D c 0.5))
(setq alfa (abs (- (* 2.0 pi) (* 4.0 (atan (/ 1.0 c))))))
(setq R (/ D (* 2.0 (sin (/ alfa 2.0)))))
(setq l_par (* (abs alfa) R))
(setq longc (+ longc l_par))
(setq a_par (* sig_c (- (* R R alfa 0.5) (* D 0.5 (- R H)))))
(setq areac (+ areac a_par))
(setq n (+ n 1))
)
(print "paso 5")
(setq area (+ (abs (/ area 2.0)) areac))
(setq perim (+ longr longc))
(print "paso 5.1")
(setq txt_narea (itoa narea))
(print "paso 5.2")
(setq txt_area (strcat "A=" (rtos area 2 2) "m2") narea (+ narea nxtn))
(setq txt_perim (strcat "P=" (rtos perim 2 2) "m"))
(setq txt_archin (strcat txt_narea "," (rtos longr 2 3) ))
(print txt_archin archin)
(setq ptoins (getpoint "Punto de inserci n de texto: ")) (terpri)�
(command "_text" ptoins ht 0 txt_narea)
(setq ent (entsel "Seleccione Polilinea 2D: ")) (terpri)
)
(close archin)
(print "Proceso finalizado sin problemas")
)
(defun c:Procesos()
(print "Distancia XY entre dos puntos: d2d")
(print "Coloca cota de un punto: Cota")
(print "Coloca altura de un punto: HPto")
(print "Datos de LWPolilineas Curvas: Curvas")
(print "Datos de Polilineas Curvas: PLcur")
(print "Coordenadas N-E de un punto: Coord")
(print "Exporta puntos del Eagle: ExpEagle")
(print "Cuenta Longitud de Lineas: CtaLn")
(print "Numera ascendente: numtxt")
(print "Coordenadas Norte de un punto: Norte")
(print "Coordenadas Este de un punto: Este")
(print "Calcula Areas: Carea")
(print "Calcula Longitudes de polilineas: Clinea")
)

More Related Content

What's hot

PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~Atsushi Torikoshi
 
The Ring programming language version 1.5.2 book - Part 34 of 181
The Ring programming language version 1.5.2 book - Part 34 of 181The Ring programming language version 1.5.2 book - Part 34 of 181
The Ring programming language version 1.5.2 book - Part 34 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 69 of 185
The Ring programming language version 1.5.4 book - Part 69 of 185The Ring programming language version 1.5.4 book - Part 69 of 185
The Ring programming language version 1.5.4 book - Part 69 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 43 of 210
The Ring programming language version 1.9 book - Part 43 of 210The Ring programming language version 1.9 book - Part 43 of 210
The Ring programming language version 1.9 book - Part 43 of 210Mahmoud Samir Fayed
 
Ugly code
Ugly codeUgly code
Ugly codeOdd-e
 
Rのスコープとフレームと環境と
Rのスコープとフレームと環境とRのスコープとフレームと環境と
Rのスコープとフレームと環境とTakeshi Arabiki
 
How To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification SystemHow To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification SystemJay Corrales
 
The Ring programming language version 1.6 book - Part 71 of 189
The Ring programming language version 1.6 book - Part 71 of 189The Ring programming language version 1.6 book - Part 71 of 189
The Ring programming language version 1.6 book - Part 71 of 189Mahmoud Samir Fayed
 
Mysql handle socket
Mysql handle socketMysql handle socket
Mysql handle socketPhilip Zhong
 
The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184Mahmoud Samir Fayed
 
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."sjabs
 
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...Databricks
 
Mysql5.1 character set testing
Mysql5.1 character set testingMysql5.1 character set testing
Mysql5.1 character set testingPhilip Zhong
 
The Ring programming language version 1.9 book - Part 94 of 210
The Ring programming language version 1.9 book - Part 94 of 210The Ring programming language version 1.9 book - Part 94 of 210
The Ring programming language version 1.9 book - Part 94 of 210Mahmoud Samir Fayed
 
Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8Philip Zhong
 
Artimon - Apache Flume (incubating) NYC Meetup 20111108
Artimon - Apache Flume (incubating) NYC Meetup 20111108Artimon - Apache Flume (incubating) NYC Meetup 20111108
Artimon - Apache Flume (incubating) NYC Meetup 20111108Mathias Herberts
 
The Ring programming language version 1.9 book - Part 78 of 210
The Ring programming language version 1.9 book - Part 78 of 210The Ring programming language version 1.9 book - Part 78 of 210
The Ring programming language version 1.9 book - Part 78 of 210Mahmoud Samir Fayed
 
The elements of a functional mindset
The elements of a functional mindsetThe elements of a functional mindset
The elements of a functional mindsetEric Normand
 
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅재춘 노
 
This is not your father's monitoring.
This is not your father's monitoring.This is not your father's monitoring.
This is not your father's monitoring.Mathias Herberts
 

What's hot (20)

PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
 
The Ring programming language version 1.5.2 book - Part 34 of 181
The Ring programming language version 1.5.2 book - Part 34 of 181The Ring programming language version 1.5.2 book - Part 34 of 181
The Ring programming language version 1.5.2 book - Part 34 of 181
 
The Ring programming language version 1.5.4 book - Part 69 of 185
The Ring programming language version 1.5.4 book - Part 69 of 185The Ring programming language version 1.5.4 book - Part 69 of 185
The Ring programming language version 1.5.4 book - Part 69 of 185
 
The Ring programming language version 1.9 book - Part 43 of 210
The Ring programming language version 1.9 book - Part 43 of 210The Ring programming language version 1.9 book - Part 43 of 210
The Ring programming language version 1.9 book - Part 43 of 210
 
Ugly code
Ugly codeUgly code
Ugly code
 
Rのスコープとフレームと環境と
Rのスコープとフレームと環境とRのスコープとフレームと環境と
Rのスコープとフレームと環境と
 
How To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification SystemHow To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification System
 
The Ring programming language version 1.6 book - Part 71 of 189
The Ring programming language version 1.6 book - Part 71 of 189The Ring programming language version 1.6 book - Part 71 of 189
The Ring programming language version 1.6 book - Part 71 of 189
 
Mysql handle socket
Mysql handle socketMysql handle socket
Mysql handle socket
 
The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184The Ring programming language version 1.5.3 book - Part 25 of 184
The Ring programming language version 1.5.3 book - Part 25 of 184
 
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."
 
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...
 
Mysql5.1 character set testing
Mysql5.1 character set testingMysql5.1 character set testing
Mysql5.1 character set testing
 
The Ring programming language version 1.9 book - Part 94 of 210
The Ring programming language version 1.9 book - Part 94 of 210The Ring programming language version 1.9 book - Part 94 of 210
The Ring programming language version 1.9 book - Part 94 of 210
 
Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8Compare mysql5.1.50 mysql5.5.8
Compare mysql5.1.50 mysql5.5.8
 
Artimon - Apache Flume (incubating) NYC Meetup 20111108
Artimon - Apache Flume (incubating) NYC Meetup 20111108Artimon - Apache Flume (incubating) NYC Meetup 20111108
Artimon - Apache Flume (incubating) NYC Meetup 20111108
 
The Ring programming language version 1.9 book - Part 78 of 210
The Ring programming language version 1.9 book - Part 78 of 210The Ring programming language version 1.9 book - Part 78 of 210
The Ring programming language version 1.9 book - Part 78 of 210
 
The elements of a functional mindset
The elements of a functional mindsetThe elements of a functional mindset
The elements of a functional mindset
 
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
 
This is not your father's monitoring.
This is not your father's monitoring.This is not your father's monitoring.
This is not your father's monitoring.
 

Similar to Analyze curves and calculate parameters for polylines and splines

CL metaprogramming
CL metaprogrammingCL metaprogramming
CL metaprogrammingdudarev
 
Class 10: Abstracting Procedures
Class 10: Abstracting ProceduresClass 10: Abstracting Procedures
Class 10: Abstracting ProceduresDavid Evans
 
Lisp and prolog in artificial intelligence
Lisp and prolog in artificial intelligenceLisp and prolog in artificial intelligence
Lisp and prolog in artificial intelligenceArtiSolanki5
 
Frsa
FrsaFrsa
Frsa_111
 
PBL1-v1-004j.pptx
PBL1-v1-004j.pptxPBL1-v1-004j.pptx
PBL1-v1-004j.pptxNAIST
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate CompilersFunctional Thursday
 
SICP勉強会について
SICP勉強会についてSICP勉強会について
SICP勉強会についてYusuke Sasaki
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love StoryUser Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love StoryDatabricks
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love StoryUser Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love StoryDatabricks
 
Super Advanced Python –act1
Super Advanced Python –act1Super Advanced Python –act1
Super Advanced Python –act1Ke Wei Louis
 
Set Operations in Unix Shell
Set Operations in Unix ShellSet Operations in Unix Shell
Set Operations in Unix ShellPeter Krumins
 
The Ring programming language version 1.10 book - Part 81 of 212
The Ring programming language version 1.10 book - Part 81 of 212The Ring programming language version 1.10 book - Part 81 of 212
The Ring programming language version 1.10 book - Part 81 of 212Mahmoud Samir Fayed
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기JangHyuk You
 
The Magnificent Seven
The Magnificent SevenThe Magnificent Seven
The Magnificent SevenMike Fogus
 
cmdfile.txtsleep 5ls -latrsleep 3pwdsleep 1wc .docx
cmdfile.txtsleep 5ls -latrsleep 3pwdsleep 1wc .docxcmdfile.txtsleep 5ls -latrsleep 3pwdsleep 1wc .docx
cmdfile.txtsleep 5ls -latrsleep 3pwdsleep 1wc .docxgordienaysmythe
 
Introduction To Lisp
Introduction To LispIntroduction To Lisp
Introduction To Lispkyleburton
 
Modern technologies in data science
Modern technologies in data science Modern technologies in data science
Modern technologies in data science Chucheng Hsieh
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語ikdysfm
 

Similar to Analyze curves and calculate parameters for polylines and splines (20)

CL metaprogramming
CL metaprogrammingCL metaprogramming
CL metaprogramming
 
Class 10: Abstracting Procedures
Class 10: Abstracting ProceduresClass 10: Abstracting Procedures
Class 10: Abstracting Procedures
 
Lisp and prolog in artificial intelligence
Lisp and prolog in artificial intelligenceLisp and prolog in artificial intelligence
Lisp and prolog in artificial intelligence
 
Frsa
FrsaFrsa
Frsa
 
PBL1-v1-004j.pptx
PBL1-v1-004j.pptxPBL1-v1-004j.pptx
PBL1-v1-004j.pptx
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
 
SICP勉強会について
SICP勉強会についてSICP勉強会について
SICP勉強会について
 
Ns2programs
Ns2programsNs2programs
Ns2programs
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love StoryUser Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love Story
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love StoryUser Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love Story
 
Super Advanced Python –act1
Super Advanced Python –act1Super Advanced Python –act1
Super Advanced Python –act1
 
Set Operations in Unix Shell
Set Operations in Unix ShellSet Operations in Unix Shell
Set Operations in Unix Shell
 
The Ring programming language version 1.10 book - Part 81 of 212
The Ring programming language version 1.10 book - Part 81 of 212The Ring programming language version 1.10 book - Part 81 of 212
The Ring programming language version 1.10 book - Part 81 of 212
 
Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기Programming Lisp Clojure - 2장 : 클로저 둘러보기
Programming Lisp Clojure - 2장 : 클로저 둘러보기
 
The Magnificent Seven
The Magnificent SevenThe Magnificent Seven
The Magnificent Seven
 
cmdfile.txtsleep 5ls -latrsleep 3pwdsleep 1wc .docx
cmdfile.txtsleep 5ls -latrsleep 3pwdsleep 1wc .docxcmdfile.txtsleep 5ls -latrsleep 3pwdsleep 1wc .docx
cmdfile.txtsleep 5ls -latrsleep 3pwdsleep 1wc .docx
 
Distributed computing with spark
Distributed computing with sparkDistributed computing with spark
Distributed computing with spark
 
Introduction To Lisp
Introduction To LispIntroduction To Lisp
Introduction To Lisp
 
Modern technologies in data science
Modern technologies in data science Modern technologies in data science
Modern technologies in data science
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語
 

Recently uploaded

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Analyze curves and calculate parameters for polylines and splines

  • 1. ; Realizado por: Ing. Napoleón Zambrano Figueroa ; Fecha: desde 2003 en adelante ; Guardar como procesos.lsp (defun c:d2d() (setq pto1 (getpoint "Punto 1:")) (terpri) (setq pto2 (getpoint pto1 "Punto 2:")) (terpri) (setq x1 (car pto1)) (setq x2 (car pto2)) (setq y1 (car (cdr pto1))) (setq y2 (car (cdr pto2))) (setq dl (sqrt (+ (* (- x2 x1) (- x2 x1)) (* (- y2 y1) (- y2 y1))))) (print "Distancia 2D: ") (prin1 dl) (prin1) ) (defun c:cota() (setq ht (getreal "Altura de texto: ")) (terpri) (setq var_osnap -1) (while (= var_osnap -1) (setq var_osnap (getint "[0]-End Point [1]-Node [2]-Inserción [3]-None: ")) (cond ((= var_osnap 0) (setq var_osnap 1) ) ((= var_osnap 1) (setq var_osnap 8) ) ((= var_osnap 2) (setq var_osnap 64) ) ((= var_osnap 3) (setq var_osnap 0) ) (setq var_osnap -1) ) ) (setq osnap_on var_osnap) (setq osnap_of (+ var_osnap 16584)) (setq pto (list 0 0 0)) (while (/= pto nil) (command "_setvar" "osmode" osnap_on) (setq pto (getpoint "Punto de cota: ")) (terpri) (if (/= pto nil) (progn (setq x (+ (car pto) (/ ht 2.))) (setq y (+ (cadr pto) (/ ht 2.))) (setq z (caddr pto)) (setq pto1 (list x y z)) (setq txt_z (rtos z 2 3)) (setq txt_z (strcat " + " txt_z)) (command "_setvar" "osmode" osnap_of) (command "_text" pto1 ht "0" txt_z) (command "_point" pto) ) ) ) ) (defun c:HPto() (setq ht (getreal "Altura de texto: ")) (terpri) (setq aa (getint "Número de decimales: ")) (terpri)
  • 2. (setq var_osnap -1) (while (= var_osnap -1) (setq var_osnap (getint "[0]-End Point [1]-Node [2]-Inserción [3]-None: ")) (cond ((= var_osnap 0) (setq var_osnap 1) ) ((= var_osnap 1) (setq var_osnap 8) ) ((= var_osnap 2) (setq var_osnap 64) ) ((= var_osnap 3) (setq var_osnap 0) ) (setq var_osnap -1) ) ) (setq osnap_on var_osnap) (setq osnap_of (+ var_osnap 16584)) (setq pto (list 0 0 0)) (while (/= pto nil) (command "_setvar" "osmode" osnap_on) (setq pto (getpoint "Punto de cota: ")) (terpri) (if (/= pto nil) (progn (setq x (+ (car pto) (/ ht 2.))) (setq y (+ (cadr pto) (/ ht 2.))) (setq z (caddr pto)) (setq pto1 (list x y z)) (setq txt_z (rtos z 2 aa)) (command "_setvar" "osmode" osnap_of) (command "_text" pto1 ht "0" txt_z) ) ) ) ) (defun c:Coord() (setq arch_txt (getstring "Archivo de Datos: ")) (terpri) (setq archin (open arch_txt "W")) (setq ht (getreal "Altura de texto: ")) (terpri) (setq dht (/ ht 2)) (setq var_osnap -1) (while (= var_osnap -1) (setq var_osnap (getint "[0]-End Point [1]-Node [2]-Centro [3]-None: ")) (cond ((= var_osnap 0) (setq var_osnap 1) ) ((= var_osnap 1) (setq var_osnap 8) ) ((= var_osnap 2) (setq var_osnap 4) ) ((= var_osnap 3) (setq var_osnap 0) ) (setq var_osnap 0) ) )
  • 3. (setq osnap_on var_osnap) (setq osnap_of (+ var_osnap 16584)) (setq pto (list 0 0 0)) (while (/= pto nil) (command "_setvar" "osmode" osnap_on) (setq pto (getpoint "Punto de cota: ")) (terpri) (if (/= pto nil) (progn (setq x (car pto) y (cadr pto) z (caddr pto)) (setq txt_N (strcat "N-" (rtos y 2 2) " ") txt_E (strcat "E-" (rtos x 2 2) " ")) (setq ptoN (list (+ x dht) (+ y dht)) ptoE (list (- x dht) (+ y dht))) (command "_setvar" "osmode" osnap_of) (command "_text" ptoN ht "0" txt_N) (command "_text" ptoE ht "90" txt_E) (setq txt_archin (strcat (rtos y 2 2) ";" (rtos x 2 2) ";" (rtos z 2 3))) (print txt_archin archin) ) ) ) (close archin) ) ; ; INICIO PROGRAMA CURVAS PARA LWPOLILINEAS ; (defun c:curvas() (setvar attrec 1) (setvar attdia 0) (setq arch_txt (getstring "Archivo de Datos: ")) (terpri) (setq archin (open arch_txt "W")) (setq txt_archin "ang ; x1 ; y1 ; x2 ; y2 ; x3 ; y3 ; Tan ; R ; L ; C") (print txt_archin archin) (setq alin_cod (entsel "Seleccione la LWPolilyne: ")) (Terpri) (setq ht (getreal "Altura de textos: ")) (Terpri) (setq alin_cod (car alin_cod)) (setq entid (entget alin_cod)) (setq cord_lst (list '(ini) )) (setq lst42 (list '(ini) )) (setq n 1 nl 0) (command "_setvar" "osmode" 0) (while (< n (length entid)) (setq elis (nth n entid)) (setq id_elis (car elis)) (cond ((= id_elis 10) (setq nl (+ nl 1)) (setq cord_lst (append cord_lst (list elis))) ) ((= id_elis 42) (setq lst42 (append lst42 (list elis))) ) ) (setq n (+ n 1)) ) (setq cord_lst (append cord_lst (list '(fin)))) (setq lst42 (append lst42 (list '(fin)))) (print cord_lst) (print lst42) (setq nelem (length cord_lst) pivot 2 vert 0 curva 0 ctrol t) (setq pto1 (cdr (nth 1 cord_lst)) pto2 (nth 2 cord_lst) pto3 (nth 3 cord_lst)) (while (/= (car pto3) 'FIN) (print pto3)
  • 4. (setq pto2 (cdr pto2)) (setq pto3 (cdr pto3)) (setq tipo (cdr (nth pivot lst42))) (setq x1 (car pto1) y1 (cadr pto1)) (setq x2 (car pto2) y2 (cadr pto2)) (setq x3 (car pto3) y3 (cadr pto3)) (if (= tipo 0) (progn ;Vertice (setq vert (+ vert 1)) (setq ang1 (angle pto1 pto2) ang2 (angle pto2 pto3)) (setq ang (- ang2 ang1)) (setq ang (abs ang)) (cond ((> ang (* 1.5 pi)) (setq ang (- (* 2. pi) ang)) ) ((> ang pi) (setq ang (- ang pi)) ) ) (setq ang_txt (angtos ang 1 4)) (command "_insert" "PI-Alfa" pto2 ht ht "0" ang_txt vert) (setq txt_archin (strcat (rtos ang 2 8) ";" (rtos x1 2 2) ";" (rtos y1 2 2) ";" (rtos x2 2 2) ";" (rtos y2 2 2) ";" (rtos x3 2 3) ";" (rtos y3 2 2))) (print txt_archin archin) (setq pto1 pto2 pivot (+ pivot 1)) ) (progn ;Arco (setq curva (+ curva 1)) (setq pto4 (nth (+ pivot 2) cord_lst)) (setq pto4 (cdr pto4)) (setq ang1 (angle pto1 pto2) ang2 (angle pto3 pto4)) (setq ang (- ang2 ang1)) (setq ang (abs ang)) (cond ((> ang (* 1.5 pi)) (setq ang (- (* 2. pi) ang)) ) ((> ang pi) (setq ang (- ang pi)) ) ) (setq ang_txt (angtos ang 1 4)) (setq pto5 (inters pto1 pto2 pto3 pto4 nil)) (setq Tan (distance pto2 pto5)) (setq ang_2 (/ ang 2.)) (setq R (/ (* Tan (cos ang_2)) (sin ang_2))) (setq L (* R ang)) (setq C (distance pto2 pto3)) (setq txt_R (rtos R 2 2) txt_Tan (rtos Tan 2 2) txt_L (rtos L 2 2) txt_C (rtos C 2 2)) (command "_insert" "Curva" pto5 ht ht "0" txt_R txt_Tan txt_L txt_C ang_txt curva) (command "_Pline" pto2 pto5 pto3 "") (setq txt_archin (strcat (rtos ang 2 8) ";" (rtos x1 2 2) ";" (rtos y1 2 2) ";" (rtos x2 2 2) ";" (rtos y2 2 2) ";" (rtos x3 2 3) ";" (rtos y3 2 2) ";" (rtos Tan 2 4) ";" (rtos R 2 4) ";" (rtos L 2 4) ";" (rtos C 2 4) ";")) (print txt_archin archin) (setq pto1 pto3 pivot (+ pivot 2)) ) ) (setq pto2 (nth pivot cord_lst)) (setq pto3 (nth (+ pivot 1) cord_lst))
  • 5. ) (close archin) (setvar attdia 1) ) ; ; FIN PROGRAMA CURVAS PARA LWPOLILINEAS ; ; ; INICIO PROGRAMA CURVAS PARA POLILINEAS ; (defun c:plcur() (setq arch_txt "d:/tmp/plcur.txt") (terpri) (setq archin (open arch_txt "W")) ;(print "No.,R,alfa,T,L,C" archin) (setq txt_archin "ang ; x1 ; y1 ; x2 ; y2 ; x3 ; y3 ; Tan ; R ; L ; C") (print txt_archin archin) (setq alin_cod (entsel "Seleccione la Polilyne: ")) (Terpri) (setq ht (getreal "Altura de textos: ")) (Terpri) (setq alin_cod (car alin_cod)) (setq entid (entget alin_cod)) (setq cord_lst (list '(ini) )) (setq lst42 (list '(ini) )) (setq n 1 nl 0) (command "_setvar" "osmode" 0) (setq alin_cod (entnext alin_cod)) (setq entid (entget alin_cod)) (setq ctrol1 (cdr (assoc 0 entid))) (while (= ctrol1 "VERTEX") (setq elis (assoc 10 entid)) (setq id_elis (assoc 42 entid)) (setq nl (+ nl 1)) (setq cord_lst (append cord_lst (list elis))) (setq lst42 (append lst42 (list id_elis))) (setq n (+ n 1)) (setq alin_cod (entnext alin_cod)) (setq entid (entget alin_cod)) (setq ctrol1 (cdr (assoc 0 entid))) ) (setq cord_lst (append cord_lst (list '(fin)))) (setq lst42 (append lst42 (list '(fin)))) (print cord_lst) (print lst42) (setq nelem (length cord_lst) pivot 2 vert 0 curva 0 ctrol t) (setq pto1 (cdr (nth 1 cord_lst)) pto2 (nth 2 cord_lst) pto3 (nth 3 cord_lst)) (while (/= (car pto3) 'FIN) (print pto3) (setq pto2 (cdr pto2)) (setq pto3 (cdr pto3)) (setq tipo (cdr (nth pivot lst42))) (setq x1 (car pto1) y1 (cadr pto1)) (setq x2 (car pto2) y2 (cadr pto2)) (setq x3 (car pto3) y3 (cadr pto3)) (cond ((and (= x1 x2) (= y1 y2)) (setq pto1 pto2 pivot (+ pivot 1)) ) ((= tipo 0) ;Vertice (setq vert (+ vert 1)) (setq ang1 (angle pto1 pto2) ang2 (angle pto2 pto3)) (setq ang (- ang2 ang1)) (setq ang (abs ang))
  • 6. (cond ((> ang (* 1.5 pi)) (setq ang (- (* 2. pi) ang)) ) ((> ang pi) (setq ang (- ang pi)) ) ) (setq ang_txt (angtos ang 1 4)) (command "_insert" "PI-Alfa" pto2 ht ht "0" ang_txt vert) (setq pto1 pto2 pivot (+ pivot 1)) (setq txt_archin (strcat (rtos ang 2 8) ";" (rtos x1 2 2) ";" (rtos y1 2 2) ";" (rtos x2 2 2) ";" (rtos y2 2 2) ";" (rtos x3 2 3) ";" (rtos y3 2 2))) (print txt_archin archin) ) (progn ;Arco (setq curva (+ curva 1)) (setq pto4 (nth (+ pivot 2) cord_lst)) (setq pto4 (cdr pto4)) (setq ang1 (angle pto1 pto2) ang2 (angle pto3 pto4)) (setq ang (- ang2 ang1)) (setq ang (abs ang)) (cond ((> ang (* 1.5 pi)) (setq ang (- (* 2. pi) ang)) ) ((> ang pi) (setq ang (- ang pi)) ) ) (setq ang_txt (angtos ang 1 4)) (setq pto5 (inters pto1 pto2 pto3 pto4 nil)) (setq Tan (distance pto2 pto5)) (setq ang_2 (/ ang 2.)) (setq R (/ (* Tan (cos ang_2)) (sin ang_2))) (setq L (* R ang)) (setq C (distance pto2 pto3)) (setq txt_R (rtos R 2 2) txt_Tan (rtos Tan 2 2) txt_L (rtos L 2 2) txt_C (rtos C 2 2)) (command "_insert" "Curva" pto5 ht ht "0" txt_R txt_Tan txt_L txt_C ang_txt curva) (command "_Pline" pto2 pto5 pto3 "") ;(setq txt_arch (strcat (itoa curva) "," txt_R "," ang_txt "," txt_tan "," txt_L "," txt_C)) ;(print txt_arch archin) (setq txt_archin (strcat (rtos ang 2 8) ";" (rtos x1 2 2) ";" (rtos y1 2 2) ";" (rtos x2 2 2) ";" (rtos y2 2 2) ";" (rtos x3 2 3) ";" (rtos y3 2 2) ";" (rtos Tan 2 4) ";" (rtos R 2 4) ";" (rtos L 2 4) ";" (rtos C 2 4) ";")) (print txt_archin archin) (setq pto1 pto3 pivot (+ pivot 2)) ) ) (setq pto2 (nth pivot cord_lst)) (setq pto3 (nth (+ pivot 1) cord_lst)) ) (close archin) ) ; ; FIN PROGRAMA CURVAS PARA POLILINEAS ; (defun c:ExpEagle()
  • 7. (setq arch_txt (getstring "Archivo de Datos: ")) (terpri) (setq archin (open arch_txt "W")) (setq pto1 (getpoint "Seleccione puntos: ")) (terpri) (setq pto2 (getcorner pto1)) (terpri) (setq ptos (list pto1 pto2)) (setq filtro (list (cons 0 "INSERT"))) (setq gr_ent (ssget "_W" pto1 pto2 filtro)) (setq num_ent (sslength gr_ent)) (setq n 0) (print "inicia repeat:" ) (repeat num_ent (setq ent_nom (ssname gr_ent n)) (setq ent (entget ent_nom)) (setq pto (cdr (assoc 10 ent))) (setq Norte (cadr pto)) (setq Este (car pto)) (setq Elev (caddr pto)) (repeat 2 (setq ent_nom (entnext ent_nom)) (setq ent (entget ent_nom)) (setq ent_tipo (cdr (assoc 8 ent))) (cond ((= ent_tipo "PNTNO") (setq pto_num (cdr (assoc 1 ent))) ) ((= ent_tipo "PNTDES") (setq Desc (cdr (assoc 1 ent))) ) ) ) (setq txt_N (rtos Norte 2 3)) (setq txt_E (rtos Este 2 3)) (setq txt_Z (rtos Elev 2 3)) (setq texto (strcat pto_num "," txt_N "," txt_E "," txt_Z "," Desc)) (print texto archin) (setq n (+ n 1)) ) (close archin) ) (defun c:CtaLn() (setq pto1 (getpoint "Seleccione puntos: ")) (terpri) (setq pto2 (getcorner pto1)) (terpri) (setq ptos (list pto1 pto2)) (setq capa (getstring "Nombre de capa: ")) (terpri) (setq filtro (list (cons 0 "LINE") (cons 8 capa))) (setq gr_ent (ssget "_C" pto1 pto2 filtro)) (setq tot_elem (sslength gr_ent)) (setq ne 0) (setq ltub 0.) (print "inicia repeat:" ) (repeat tot_elem (setq vr_nom (ssname gr_ent ne)) (setq ln_car (entget vr_nom)) (setq pto1 (cdr (assoc 10 ln_car))) (setq x1 (car pto1)) (setq y1 (car (cdr pto1))) (setq z1 (car (cdr (cdr pto1)))) (setq pto1 (cdr (assoc 11 ln_car))) (setq x2 (car pto1)) (setq y2 (car (cdr pto1))) (setq z2 (car (cdr (cdr pto1)))) (setq lt (sqrt (+ (* (- x2 x1) (- x2 x1)) (* (- y2 y1) (- y2 y1))))) (setq ltub (+ ltub lt) ne (+ ne 1))
  • 8. ) (print "Numero de elementos: ") (prin1 tot_elem) (print "Longitud Total: ") (prin1 ltub) (print) ) (defun c:numtxt() (setq ht (getreal "Altura de texto: ")) (terpri) (setq var_osnap -1) (while (= var_osnap -1) (setq var_osnap (getint "[0]-Punto final [1]-Nudo [2]-Ninguno: ")) (cond ((= var_osnap 0) (setq var_osnap 1) ) ((= var_osnap 1) (setq var_osnap 8) ) ((= var_osnap 2) (setq var_osnap 0) ) (setq var_osnap -1) ) ) (setq incr (getreal "Número inicial: ")) (terpri) (setq nxtn (getreal "Incremento: ")) (terpri) (setq incr (- incr nxtn)) (setq osnap_on var_osnap) (setq osnap_of (+ var_osnap 16584)) (setq pto (list 0 0 0)) (while (/= pto nil) (command "_setvar" "osmode" osnap_on) (setq pto (getpoint "Punto de inserción: ")) (terpri) (if (/= pto nil) (progn (setq incr (+ incr nxtn)) (setq txt_incr (rtos incr 2 0)) (command "_setvar" "osmode" osnap_of) (command "_text" pto ht "0" txt_incr) ) ) ) ) (defun c:Norte() (setq ht (getreal "Altura de texto: ")) (terpri) (setq prec (getint "Precisión: ")) (terpri) (setq dht (/ ht 2)) (setq var_osnap -1) (while (= var_osnap -1) (setq var_osnap (getint "[0]-End Point [1]-Node [2]-Intersección [3]-None: ")) (cond ((= var_osnap 0) (setq var_osnap 1) ) ((= var_osnap 1) (setq var_osnap 8) ) ((= var_osnap 2) (setq var_osnap 32) )
  • 9. ((= var_osnap 3) (setq var_osnap 0) ) (setq var_osnap -1) ) ) (setq osnap_on var_osnap) (setq osnap_of (+ var_osnap 16584)) (setq pto (list 0 0 0)) (while (/= pto nil) (command "_setvar" "osmode" osnap_on) (setq pto (getpoint "Punto de cota: ")) (terpri) (if (/= pto nil) (progn (setq x (car pto) y (cadr pto) z (caddr pto)) (setq txt_N (strcat "N-" (rtos y 2 prec) " ") txt_E (strcat "E-" (rtos x 2 prec) " ")) (setq ptoN (list (+ x dht) (+ y dht)) ptoE (list (- x dht) (+ y dht))) (command "_setvar" "osmode" osnap_of) (command "_text" ptoN ht "0" txt_N) ) ) ) ) (defun c:Este() (setq ht (getreal "Altura de texto: ")) (terpri) (setq prec (getint "Precisi n: ")) (terpri)� (setq dht (/ ht 2)) (setq var_osnap -1) (while (= var_osnap -1) (setq var_osnap (getint "[0]-End Point [1]-Node [2]-Intersecci n [3]-� None: ")) (cond ((= var_osnap 0) (setq var_osnap 1) ) ((= var_osnap 1) (setq var_osnap 8) ) ((= var_osnap 2) (setq var_osnap 32) ) ((= var_osnap 3) (setq var_osnap 0) ) (setq var_osnap -1) ) ) (setq osnap_on var_osnap) (setq osnap_of (+ var_osnap 16584)) (setq pto (list 0 0 0)) (while (/= pto nil) (command "_setvar" "osmode" osnap_on) (setq pto (getpoint "Punto de cota: ")) (terpri) (if (/= pto nil) (progn (setq x (car pto) y (cadr pto) z (caddr pto)) (setq txt_N (strcat "N-" (rtos y 2 prec) " ") txt_E (strcat "E-" (rtos x 2 prec) " ")) (setq ptoN (list (+ x dht) (+ y dht)) ptoE (list (- x dht) (+ y dht))) (command "_setvar" "osmode" osnap_of) (command "_text" ptoE ht "90" txt_E) )
  • 10. ) ) ) ; calcula areas (defun c:Carea() (setq arch_txt (getstring "Archivo de Datos: ")) (terpri) (setq archin (open arch_txt "W")) (print "#Area,Area,Perimetro" archin) (setq ht (getreal "Altura de texto: ")) (terpri) (setq incr (getint "N mero inicial: ")) (terpri)� (setq nxtn (getint "Incremento: ")) (terpri) (setq narea incr) (setq ent (entsel "Seleccione Polilinea 2D: ")) (terpri) (while (/= ent nil) (setq longr 0.0) (setq ent_nom (car ent)) (setq ent (entget ent_nom)) (setq lista ent) (setq pto (assoc 10 ent)) (setq listx (list) listy (list) listc (list) listD (list)) (print "paso 0") (while (/= pto nil) (setq x1 (cadr pto)) (setq y1 (caddr pto)) (setq lx (list x1) ly (list y1)) (setq listx (append listx lx) listy (append listy ly)) (setq c_lista (assoc 42 lista)) (setq c (cdr c_lista)) (setq lista (cdr (member c_lista lista))) (setq pto (assoc 10 lista)) (if (and (/= c 0) (/= pto nil)) (progn (setq x2 (cadr pto)) (setq y2 (caddr pto)) (setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0)))) (setq lc (list c) lD (list D)) (setq listc (append listc lc) listD (append listD lD)) ) ) (if (and (/= c 0) (= pto nil)) (progn (setq x2 (car listx)) (setq y2 (car listy)) (setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0)))) (setq lc (list c) lD (list D)) (setq listc (append listc lc) listD (append listD lD)) ) ) (if (= c 0) (progn (if (/= pto nil) (progn (setq x2 (cadr pto)) (setq y2 (caddr pto)) ) (progn (setq x2 (car listx)) (setq y2 (car listy)) ) ) (setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0)))) (setq longr (+ longr D)) )
  • 11. ) ) (print "paso 3") (setq lx (list (car listx)) ly (list (car listy))) (setq listx (append listx lx) listy (append listy ly)) (setq n 0 area 0.0) (repeat (- (length listx) 1) (setq x1 (nth n listx) y1 (nth n listy)) (setq x2 (nth (+ n 1) listx) y2 (nth (+ n 1) listy)) (setq area (+ area (- (* x1 y2) (* x2 y1)))) (setq n (+ n 1)) ) (print "paso 4") (setq n 0 areac 0.0 longc 0.0) (repeat (length listc) (setq c (nth n listc) D (nth n listD)) (setq sig_c (/ c (abs c)) c (abs c)) (setq H (* D c 0.5)) (setq alfa (abs (- (* 2.0 pi) (* 4.0 (atan (/ 1.0 c)))))) (setq R (/ D (* 2.0 (sin (/ alfa 2.0))))) (setq l_par (* (abs alfa) R)) (setq longc (+ longc l_par)) (setq a_par (* sig_c (- (* R R alfa 0.5) (* D 0.5 (- R H))))) (setq areac (+ areac a_par)) (setq n (+ n 1)) ) (print "paso 5") (setq area (+ (abs (/ area 2.0)) areac)) (setq perim (+ longr longc)) (print "paso 5.1") (setq txt_narea (itoa narea)) (print "paso 5.2") (setq txt_area (strcat "A=" (rtos area 2 2) "m2") narea (+ narea nxtn)) (setq txt_perim (strcat "P=" (rtos perim 2 2) "m")) (setq txt_archin (strcat txt_narea "," (rtos area 2 3) "," (rtos perim 2 3) )) (print txt_archin archin) (setq ptoins (getpoint "Punto de inserci n de texto: ")) (terpri)� (command "_text" ptoins ht 0 txt_narea) (setq ent (entsel "Seleccione Polilinea 2D: ")) (terpri) ) (close archin) (print "Proceso finalizado sin problemas") ) ; calcula longitudes de lineas (defun c:Clinea() (setq arch_txt (getstring "Archivo de Datos: ")) (terpri) (setq archin (open arch_txt "W")) (print "#linea,Longitud" archin) (setq ht (getreal "Altura de texto: ")) (terpri) (setq incr (getint "N mero inicial: ")) (terpri)� (setq nxtn (getint "Incremento: ")) (terpri) (setq narea incr) (setq ent (entsel "Seleccione Polilinea 2D: ")) (terpri) (while (/= ent nil) (setq longr 0.0) (setq ent_nom (car ent)) (setq ent (entget ent_nom)) (setq lista ent) (setq pto (assoc 10 ent)) (setq listx (list) listy (list) listc (list) listD (list)) (print "paso 0") (while (/= pto nil)
  • 12. (setq x1 (cadr pto)) (setq y1 (caddr pto)) (setq lx (list x1) ly (list y1)) (setq listx (append listx lx) listy (append listy ly)) (setq c_lista (assoc 42 lista)) (setq c (cdr c_lista)) (setq lista (cdr (member c_lista lista))) (setq pto (assoc 10 lista)) (if (and (/= c 0) (/= pto nil)) (progn (setq x2 (cadr pto)) (setq y2 (caddr pto)) (setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0)))) (setq lc (list c) lD (list D)) (setq listc (append listc lc) listD (append listD lD)) ) ) (if (and (/= c 0) (= pto nil)) (progn (setq x2 (car listx)) (setq y2 (car listy)) (setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0)))) (setq lc (list c) lD (list D)) (setq listc (append listc lc) listD (append listD lD)) ) ) (if (= c 0) (progn (if (/= pto nil) (progn (setq x2 (cadr pto)) (setq y2 (caddr pto)) ) (progn (setq x2 (car listx)) (setq y2 (car listy)) ) ) (setq D (sqrt (+ (expt (- x2 x1) 2.0) (expt (- y2 y1) 2.0)))) (setq longr (+ longr D)) ) ) ) (print "paso 3") (setq lx (list (car listx)) ly (list (car listy))) (setq listx (append listx lx) listy (append listy ly)) (setq n 0 area 0.0) (repeat (- (length listx) 1) (setq x1 (nth n listx) y1 (nth n listy)) (setq x2 (nth (+ n 1) listx) y2 (nth (+ n 1) listy)) (setq area (+ area (- (* x1 y2) (* x2 y1)))) (setq n (+ n 1)) ) (print "paso 4") (setq n 0 areac 0.0 longc 0.0) (repeat (length listc) (setq c (nth n listc) D (nth n listD)) (setq sig_c (/ c (abs c)) c (abs c)) (setq H (* D c 0.5)) (setq alfa (abs (- (* 2.0 pi) (* 4.0 (atan (/ 1.0 c)))))) (setq R (/ D (* 2.0 (sin (/ alfa 2.0))))) (setq l_par (* (abs alfa) R)) (setq longc (+ longc l_par)) (setq a_par (* sig_c (- (* R R alfa 0.5) (* D 0.5 (- R H)))))
  • 13. (setq areac (+ areac a_par)) (setq n (+ n 1)) ) (print "paso 5") (setq area (+ (abs (/ area 2.0)) areac)) (setq perim (+ longr longc)) (print "paso 5.1") (setq txt_narea (itoa narea)) (print "paso 5.2") (setq txt_area (strcat "A=" (rtos area 2 2) "m2") narea (+ narea nxtn)) (setq txt_perim (strcat "P=" (rtos perim 2 2) "m")) (setq txt_archin (strcat txt_narea "," (rtos longr 2 3) )) (print txt_archin archin) (setq ptoins (getpoint "Punto de inserci n de texto: ")) (terpri)� (command "_text" ptoins ht 0 txt_narea) (setq ent (entsel "Seleccione Polilinea 2D: ")) (terpri) ) (close archin) (print "Proceso finalizado sin problemas") ) (defun c:Procesos() (print "Distancia XY entre dos puntos: d2d") (print "Coloca cota de un punto: Cota") (print "Coloca altura de un punto: HPto") (print "Datos de LWPolilineas Curvas: Curvas") (print "Datos de Polilineas Curvas: PLcur") (print "Coordenadas N-E de un punto: Coord") (print "Exporta puntos del Eagle: ExpEagle") (print "Cuenta Longitud de Lineas: CtaLn") (print "Numera ascendente: numtxt") (print "Coordenadas Norte de un punto: Norte") (print "Coordenadas Este de un punto: Este") (print "Calcula Areas: Carea") (print "Calcula Longitudes de polilineas: Clinea") )