rutina con error
Publicado por JORGE VERGARA C (6 intervenciones) el 02/04/2020 19:03:37
Alguien me puede ayudar con este codigo, que lo reviso y dentro de su logica esta bien, pero no se en que momento falla y no realiza lo que debe, esta rutina dibuja una polylinea y el luego el programa pide indicar dos puntos en pantalla sobre cualquier punto de la linea y debe dibujar dos textos sonbre dicho elemento, obviamente se hace una operacion para que el proximo punto de la ubicacion del texto que sobre la linea, al principio funciona bien, pero despues de unas par de veces vuelve a dibujar los textos sobre la polilynea, espero me puedan indicar conde esta el error, o la manera de sobrescrbir codigo, aca dejo codigo.
atento a vuestras consultas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
(Defun Limpia()
(Repeat 3 (Prompt "Command: ") (Print))
)
(Defun C:L2()
(Setq Layer_Linea "Linea_electrica")
(Setq Color_Linea 7)
(Setq Layer_Texto "Linea_electrica")
(Setq Color_Texto 7)
(Setq Altura_Texto 1.5)
(Setq Estilo "ROMANS")
(Setq Justificacion "Middle")
(Setq Distancia_Texto_Linea 1.0)
(Command "layer" "n" Layer_Linea "c" Color_Linea Layer_Linea "")
(Command "layer" "n" Layer_Texto "c" Color_Texto Layer_Texto "")
(Command "osnap" "ins")
(Limpia)
(Setq Punto_Inicio (Getpoint "Seleccione Primer Punto Inicio :"))
(If Punto_Inicio
(Progn
(Limpia)
(Setq Punto_Fin (Getpoint Punto_Inicio "Seleccione Segundo Punto Fin :"))
(Command "Pline" Punto_Inicio Punto_Fin "")
(Command "Chprop" "Last" "" "LA" Layer_Linea "")
(Limpia)
(Setq Distancia (Distance Punto_Inicio Punto_Fin))
(Setq Valor_Texto Distancia)
(Setq Angulo_Radianes (Angle Punto_Inicio Punto_Fin))
(Setq Angulo_Grados (/ (* Angulo_Radianes 180) PI))
(Setq Angulo_Grados2 (+ Angulo_Grados 90))
(Command "osnap" "NEA")
(setq Pto_1 (getpoint "\nPrimer punto: ")) (terpri)
(Setq Pto_mid (Polar Pto_1 (/ (* Angulo_Grados2 PI) 180.0) Distancia_Texto_Linea))
(If (And (>= Angulo_Grados 90) (<= Angulo_Grados 270) )
(Progn
(Setq Angulo_Radianes (Angle Punto_Fin Punto_Inicio))
(Setq Angulo_Grados (/ (* Angulo_Radianes 180) PI))
)
)
(setq Vano_electrico1 (getstring "INGRESA VANO ELECTRICO 1 : "))(TERPRI)
(Command "text" "s" Estilo "j" Justificacion Pto_mid Altura_Texto Angulo_Grados Vano_electrico1 )
(Command "Chprop" "Last" "" "LA" Layer_Texto "" )
(setq Pto_2 (getpoint "\nSegundo Vano: ")) (terpri)
(Setq Pto_mid2 (Polar Pto_2 (/ (* Angulo_Grados2 PI) 180.0) Distancia_Texto_Linea))
(If (And (>= Angulo_Grados 90) (<= Angulo_Grados 270) )
(Progn
(Setq Angulo_Radianes (Angle Punto_Fin Punto_Inicio))
(Setq Angulo_Grados (/ (* Angulo_Radianes 180) PI))
)
)
(setq Vano_electrico2 (getstring "INGRESA MEDIO AMERICANO 2 : "))(TERPRI)
(Command "text" "s" Estilo "j" Justificacion Pto_mid2 Altura_Texto Angulo_Grados Vano_electrico2 )
(Command "Chprop" "Last" "" "LA" Layer_Texto "")
)
)
)
(Print)
)
atento a vuestras consultas
Valora esta pregunta


0