Está en la página 1de 11

;;Programa que genera el perfil longitudinal en base a un archivo ASCII

;;de datos kilometraje y cota separados por espacios en blanco.

;;Formato actualizado

;;Ultima Actualizacion 11-11-2000

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun conpl (/ arch a_s l1 blay)

(setvar "modemacro" "Buscando Layers ......")

(setq blay (tblsearch "layer" "marco"))

(if (= blay nil)(command "layer" "m" "marco" "c" "8" "" ""))

(setq blay (tblsearch "layer" "malla"))

(if (= blay nil)(command "layer" "m" "malla" "c" "8" "" ""))

(setq blay (tblsearch "layer" "perfil"))

(if (= blay nil)(command "layer" "m" "perfil" "c" "3" "" ""))

(setq blay (tblsearch "layer" "perf-text"))

(if (= blay nil)(command "layer" "m" "perf-text" "c" "1" "" ""))

(setq blay (tblsearch "layer" "TEXT-KM"))

(if (= blay nil)(command "layer" "m" "TEXT-KM" "c" "2" "" ""))

(setq blay (tblsearch "layer" "TEXT-GRID"))

(if (= blay nil)(command "layer" "m" "TEXT-GRID" "c" "1" "" ""))

(setq blay (tblsearch "layer" "TEXT-cota"))

(if (= blay nil)(command "layer" "m" "TEXT-cota" "c" "7" "" ""))

(setvar "modemacro" "Lista la Creacion de Layers ......")

(setq arch (getfiled "Archivo a Leer" "" "csv" 4))

(setq a_s (open arch "r"))

(setq l1 (read-line a_s))

(l_l)
(while (= km nil)

(setq l1 (read-line a_s))

(l_l)

(per)

(mal)

(tex)

(command "ucs" "")

(setvar "clayer" clay )

(command "zoom" "e")

(command "zoom" ".8x")

(princ (strcat "\nListo se Termino de dibujar el Perfil Longitudinal..." arch))

(setvar "cecolor" "bylayer")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun per (/ p0 p1 p2 p3 conj)

(setvar "modemacro" "Creando el Perfil....")

(setq p0 (list (* -1.00 km) cota))

(command "ucs" "o" p0 )

(setq bus (tblsearch "ucs" "perfil"))

(if (= bus nil)

(command "ucs" "s" "perfil" )

(command "ucs" "r" "perfil" )

(setq p1 (list km cota))

(setq l1 (read-line a_s))


(l_l)

(while (= km nil)

(setq l1 (read-line a_s))

(l_l)

(setq p2 (list km cota))

(setvar "clayer" "perfil" )

(command "pline" p1 p2 "")

(setq e21 (entlast))

(while (setq l1 (read-line a_s))

(l_l)

(if (/= km nil)

(progn

(setq p3 (list km cota))

(setvar "clayer" "perfil" )

(command "line" p2 p3 "")

(princ "\nProcesando Perfil Longitudinal .... Por Favor Espere")

(setq p2 p3)

(close a_s)

(setq conj (ssget "x" (list (cons 0 "line")(cons 8 "perfil"))))

(command "pedit" e21 "j" conj "" "")

(command "ucs" "")

(command "zoom" "e")


(command "zoom" ".7x")

(setq pz1 (list (nth 0 (getvar "extmin"))

(- (nth 1 (getvar "extmin"))(* ech 0.01))))

(setq pz2 (list (nth 0 (getvar "extmax"))

(+ (nth 1 (getvar "extmax"))(* ech 0.01))))

(command "ucs" "r" "perfil")

(setq pz1 (trans pz1 0 1))

(setq pz2 (trans pz2 0 1))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun mal ()

;; (/ i1 i2 vi lo v1 v2 desn n1)

(setvar "modemacro" "Creando Malla...")

(setvar "clayer" "marco" )

(setq i1 (list (- (nth 0 pz1) 10.00) (nth 1 pz1)))

(setq i2 (list (- (nth 0 i1) 120.00) (nth 1 i1)))

(setvar "clayer" "MARCO")

(setvar "cecolor" "3")

(command "style" "rt" "romant" (* ech 0.0025) "1.20" "15" "" "" "")

(command "text" (list (+ (nth 0 i2) 5.0) (- (nth 1 i2) 20.30)) "0"

"KILOMETRAJE")

(command "text" (list (+ (nth 0 i2) 5.0) (- (nth 1 i2) 52.30)) "0"

"PENDIENTE")

(command "text" (list (+ (nth 0 i2) 5.0) (- (nth 1 i2) 75.30)) "0"

"COTA TERRENO")

(command "text" (list (+ (nth 0 i2) 5.0) (- (nth 1 i2) 105.30)) "0"
"COTA RASANTE")

(command "text" (list (+ (nth 0 i2) 5.0) (- (nth 1 i2) 135.30)) "0"

"ALTURA DE CORTE")

(command "text" (list (+ (nth 0 i2) 5.0) (- (nth 1 i2) 165.30)) "0"

"ALTURA DE RELLENO")

(command "text" (list (+ (nth 0 i2) 5.0) (- (nth 1 i2) 195.30)) "0"

"TIPO DE TERRENO")

(command "text" (list (+ (nth 0 i2) 5.0) (- (nth 1 i2) 225.30)) "0"

"ALINEAMIENTO")

(setvar "cecolor" "2")

(command "line" i1 (list (nth 0 i1)(- (nth 1 i1) 240.00)) "" )

(command "line" i2 (list (nth 0 i2)(- (nth 1 i2) 240.00)) "" )

(command "line" i1 i2 "" )

(setq i1 (entlast))

(command "copy" i1 "" "@" "@0,-40")

(setq i1 (entlast))

(command "copy" i1 "" "@" "@0,-20")

(setq i1 (entlast))

(command "copy" i1 "" "@" "@0,-30")

(setq i1 (entlast))

(command "copy" i1 "" "@" "@0,-30")

(setq i1 (entlast))

(command "copy" i1 "" "@" "@0,-30")

(setq i1 (entlast))

(command "copy" i1 "" "@" "@0,-30")

(setq i1 (entlast))
(command "copy" i1 "" "@" "@0,-30")

(setq i1 (entlast))

(command "copy" i1 "" "@" "@0,-30")

(setvar "cecolor" "1")

(command "line" (list (nth 0 pz1)(- (nth 1 pz1) 240.00))

(list (nth 0 pz1)(nth 1 pz2)) "")

(command "line" (list (nth 0 pz2)(- (nth 1 pz1) 240.00)) pz2 "")

(command "line" pz2 (list (nth 0 pz1)(nth 1 pz2)) "")

(command "line" pz1 (list (nth 0 pz2)(nth 1 pz1)) "")

(setq e0 (entlast))

(command "copy" e0 "" "0,0" "@0,-40")

(command "copy" e0 "" "0,0" "@0,-60")

(command "copy" e0 "" "0,0" "@0,-90")

(command "copy" e0 "" "0,0" "@0,-120")

(command "copy" e0 "" "0,0" "@0,-150")

(command "copy" e0 "" "0,0" "@0,-180")

(command "copy" e0 "" "0,0" "@0,-210")

(command "copy" e0 "" "0,0" "@0,-240")

(setvar "textstyle" "standard")

(setq vi (itoa (fix (nth 1 pz1))))

(setq lo (strlen vi))

(if (= lo 2)(setq k2 0))

(if (= lo 3)(setq k2 (atof (strcat (substr vi 1 1) "0"))))

(if (= lo 4)(setq k2 (atof (strcat (substr vi 1 2) "0"))))

(if (= lo 5)(setq k2 (atof (strcat (substr vi 1 2) "00"))))

(if (= lo 6)(setq k2 (atof (strcat (substr vi 1 3) "00"))))


(while (< k2 (nth 1 pz1))

(setq k2 (+ (/ ecv 10.00) k2))

(while (and (> k2 (nth 1 pz1))(< k2 (nth 1 pz2)))

(setq pp1 (list (nth 0 pz1) k2))

(setq pp2 (list (nth 0 pz2) k2))

(setq pp3 (list (- (nth 0 pz1) 2.00) k2))

(setvar "cecolor" "bylayer")

(setvar "clayer" "malla" )

(command "line" pp1 pp2 "")

(setvar "clayer" "TEXT-GRID" )

(command "text" "r" pp3 "3.00" "0" (rtos (/ k2 fec) 2 2))

(setq k2 (+ (/ ecv 10.00) k2))

(princ "\nColocando Malla .... Por Favor Espere")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun tex (/ ptc pta a_s l1)

(setvar "cecolor" "bylayer")

(setvar "modemacro" "Colocando Textos...")

(setq a_s (open arch "r"))

(command "style" "perfil" "simplex" (* ech 0.0015) "1.20" "15" "" "" "")

(while (setq l1 (read-line a_s))

(l_l)

(if (/= km nil)

(progn
(setq kmt (rtos km 2 2))

(setq cotat (rtos (/ cota fec) 2 3))

(setq ptc (list km (- (nth 1 pz1) 75.00)))

(setq ptk (list km (- (nth 1 pz1) 20.00)))

(setvar "clayer" "TEXT-cota" )

(command "text" "c" ptc "90" cotat)

(setvar "clayer" "TEXT-KM" )

(setq k1 (rtos km 2 2))

(setq ck1 (strlen k1))

(if (= ck1 4)(n1))

(if (= ck1 5)(n2))

(if (= ck1 6)(n3))

(if (= ck1 7)(n4))

(if (= ck1 8)(n5))

(if (= ck1 9)(n6))

(command "text" "c" ptk "90" k11)

(setvar "clayer" "malla" )

(command "line" (list (nth 0 ptc)(nth 1 pz1)) (list (nth 0 ptc)(nth 1 pz2)) "")

(princ "\nColocando Textos .... Por Favor Espere")

(close a_s)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun n1 (/ a1 a2)
(setq k11 (strcat "0+00" k1))

(defun n2 (/ a1 a2)

(setq k11 (strcat "0+0" k1))

(defun n3 (/ a1 a2)

(setq k11 (strcat "0+" k1))

(defun n4 (/ a1 a2)

(setq a1 (substr k1 1 1))

(setq a2 (substr k1 2))

(setq k11 (strcat a1 "+" a2))

(defun n5 (/ a1 a2)

(setq a1 (substr k1 1 2))

(setq a2 (substr k1 3))

(setq k11 (strcat a1 "+" a2))

(defun n6 (/ a1 a2)

(setq a1 (substr k1 1 3))

(setq a2 (substr k1 4))


(setq k11 (strcat a1 "+" a2))

;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun l_l (/ lista1 )

(setq lista1 (eval (read (strcat "(list "l1")" ))))

(setq km (nth 0 lista1));;Acumulada

(setq cota (* (nth 1 lista1) fec));;Cota del Terreno

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun c:perfil (/ fec pm2 pm1 va2 e21 ie es co te ia gr mi sg km cota

ech ecv lista1 cotat kmt arch a_s clay busq pn

l1 )

(setvar "cmdecho" 0)

(setvar "cecolor" "bylayer")

(setq clay (getvar "clayer"))

(setvar "textstyle" "standard")

(setvar "dimzin" 1)

(setvar "luprec" 2)

(setvar "lunits" 2)

(setq ech (getdist "\nEscala Horizontal: "))

(setq ecv (getdist "\nEscala Vertical: "))

(setq fec (/ ech ecv))

(conpl)

(setvar "clayer" clay )

(setvar "modemacro" ".")


(setvar "cmdecho" 1)

(prin1)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(princ "\nPrograma Cargado Tipee PERFIL para ejecutarlo")

También podría gustarte