(DEFUN c:cuadro (/ )
;CUADRO DE CONSTRUCCION
(setvar "BLIPMODE" 0) (setvar "CMDECHO"
0) (setvar "osmode" 0)
(initget 6)
(if (setq TT (getreal "\nAltura de texto en el
cuadro de contruccion: <2>")) ()
(setq tt 2))
(initget 6)
(if (setq TTV (getreal "\nAltura del texto en
cada vertice: <4>")) ()
(setq ttv 3.5))
(setq pi_cc (getpoint "\nPunto de inicio del
cuadro: "))(terpri)
;angulo y distancia para colocar nombres de
vertices
(setq XI_c (nth 0 pi_cc) YI_c (nth 1 pi_cc)
ym_c yi_c)
(setq E_T (* 2 TT) R:G "%%" R:C "0" RCI (*
TTV 1.05))
(command "STYLE" "R"
"C:\\ACADr13\\com\\fonts\\ROMANd.shx" "" ""
"" "" "" "")
(command "UNITS" "2" "3" "4" "4" "0.0000r"
"N")
(command "PDMODE" "32") (command
"PDSIZE" "1.00")
(command "LAYER" "m" "CIR" "C" "1" "CIR" "")
(command "LAYER" "m" "V" "C" "5" "V" "")
(command "LAYER" "m" "CC" "C" "5" "CC" "")
(command "LAYER" "m" "DP" "C" "6" "DP" "")
(command "layer" "m" "masc" "c" "1" "masc" "")
(setq NPOL (ENTSEL "Designe polilinea
cerrada: \n")) (setq NPOL (car NPOL))
(WHILE (/= (cdr (assoc 0 (entget NPOL)))
"POLYLINE") ;TRAMPAS
(alert "No se trata de una Polilinea, oprima
CONTROL+C")(terpri)
(setq NPOL (ENTSEL "Designe polilinea
cerrada: \n"))
(setq NPOL (car NPOL)) )
(WHILE Emoticono smile (cdr (assoc 70
(entget NPOL))) 0)
(alert "Es una polilinea abierta, oprima
CONTROL+C")(terpri)
(setq NPOL (ENTSEL "DESIGNAR
POLILINEA CERRADA: \n"))
(setq NPOL (car NPOL)) )
(setq LPOL (entget NPOL)) ;la lista de la
polilinea
(setq NP1 (entnext NPOL)) ;nombre del primer
vertice
;numero de vertices de la polilinea
(setq NOME NP1 NP 0 SX_CT 0 SY_CT 0)
(setq CTRL t)
(WHILE ctrl (setq NVER (entnext NOME)
LVER (entget NOME))
(setq BAN (assoc 0 LVER)) ;ciclo de bandera
(setq BAN (cdr BAN)) (setq P_CT (assoc 10
LVER))
(if Emoticono smile BAN "VERTEX")
(progn (setq NP (1+ NP))
(setq X_CT (nth 1 P_CT) Y_CT (nth 2 P_CT))
(setq SX_CT (+ sx_ct x_ct) SY_CT (+ sy_ct
y_ct))
;cambio de nombre a la entidad siguiente
(setq NOME (entnext NOME))) (setq ctrl NIL)
))
(setq P_CV (list (/ SX_CT NP) (/ SY_CT NP)))
(setq L_VER (LIST NP)) ;construccion de lista
de vertices
(setq NOME NP1 NPV 1) ;COORDENADAS
(REPEAT NP
(setq NVER (entnext NOME) LVER (entget
NOME))
(setq P2 (assoc 10 LVER))
(command "layer" "s" "v" "") ;dibujo de texto y
circulo en vertices
(setq XY_V (list (nth 1 p2) (nth 2 p2)))
(setq PD_0 (polar P_CV (angle P_CV XY_V)
(+ (* 2 ttv) (distance P_cv XY_V))))
(command "text" "mc" PD_0 ttv "" (itoa npv))
(command "layer" "s" "cir" "")
(command "circle" PD_0 rci)
(command "layer" "s" "dp" "")
(command "point" (list (nth 1 p2) (nth 2 p2)))
(setq PT2 (list (list (nth 1 P2) (nth 2 P2)) NPV))
(setq NOME (entnext NOME)) ;cambio de
nombre a la entidad siguiente
(setq L_VER (cons PT2 L_ver))
(setq NPV (1+ NPV)) ;incremento al numero
de vertices
)
(setq L_VER (reverse L_VER)) ;list invertida
de la polilinea
(command "layer" "s" "cc" "") ;dibujo del cuadro
de construccion
(setq x_pv (+ xi_c (* tt 5)) x_d (+ xi_c (* tt 15)))
(setq x_r (+ xi_c (* tt 30)) x_v (+ xi_c (* tt 35)))
(setq x_x (+ xi_c (* tt 45)) x_y (+ xi_c (* tt 55)))
(setq pp_1 (car (nth 1 L_ver)) pp_3 pp_1)
(setq n_v 2)
(repeat (- np 1)
(setq pp_2 (car (nth n_v L_ver)))
(setq V_2 (cadr (nth n_v L_ver)))
(setq D (distance pp_1 pp_2))
(setq R:0 (angtos (angle pp_1 pp_2) 4 4))
(cond ( Emoticono smile (substr r:0 4 1) "d")
(setq r:01 (substr r:0 1 2) r:02 (substr r:0 3 1))
(setq r:1 (strcat r:01 r:c r:02) r:2 (substr r:0 4)) )
( (setq r:1 (substr r:0 1 4) r:2 (substr r:0 5)) ))
(setq r:u (strcat r:1 r:g r:2))
(cond ( Emoticono smile (ascii (substr r:u 9 1))
39)
(setq r:1m (substr r:u 1 7) r:2m (substr r:u 8))
(setq r:u (strcat r:1m r:c r:2m)) ))
(cond ( Emoticono smile (strlen r:u) 14)
(setq r:1s (substr r:u 1 10) r:2s (substr r:u 11))
(setq r:u (strcat r:1s r:c r:2s)) ))
(command "text" "r" (list xi_c yi_c) tt "" (itoa (V_2 1)))
(command "text" "r" (list x_pv yi_c) tt "" (itoa
v_2))
(command "text" "r" (list x_d yi_c) tt "" (rtos d))
(command "text" "r" (list x_r yi_c) tt "" r:u)
(command "text" "r" (list x_v yi_c) tt "" (itoa
v_2))
(command "text" "r" (list x_x yi_c) tt "" (rtos (car
pp_2)))
(command "text" "r" (list x_y yi_c) tt "" (rtos
(cadr pp_2)))
(setq n_v (+ 1 N_V)) (setq yi_c (- yi_c e_t))
(setq pp_1 pp_2)
) ;cierra repeat
(command "text" "r" (list xi_c yi_c) tt "" (itoa
V_2))
(command "text" "r" (list x_pv yi_c) tt "" "1")
(setq D (distance pp_1 pp_3))
(setq R:0 (angtos (angle pp_1 pp_3) 4 4))
(cond ( Emoticono smile (substr r:0 4 1) "d")
(setq r:01 (substr r:0 1 2)) (setq r:02 (substr r:0
3 1))
(setq r:1 (strcat r:01 r:c r:02)) (setq r:2 (substr
r:0 4)) )
( (setq r:1 (substr r:0 1 4)) (setq r:2 (substr r:0
5)) ))
(setq r:u (strcat r:1 r:g r:2))
(cond ( Emoticono smile (ascii (substr r:u 9 1))
39)
(setq r:1m (substr r:u 1 7) r:2m (substr r:u 8))
(setq r:u (strcat r:1m r:c r:2m)) ))
(cond ( Emoticono smile (strlen r:u) 14)
(setq r:1s (substr r:u 1 10) r:2s (substr r:u 11))
(setq r:u (strcat r:1s r:c r:2s)) ))
(command "text" "r" (list x_d yi_c) tt "" (rtos d))
(command "text" "r" (list x_r yi_c) tt "" r:u)
(command "text" "r" (list x_v yi_c) tt "" "1")
(command "text" "r" (list x_x yi_c) tt "" (rtos (car
pp_3)))
(command "text" "r" (list x_y yi_c) tt "" (rtos
(cadr pp_3)))
;calculo del area
(command "AREA" "e" npol)
(setq AR (GETVAR "area") AR (rtos ar 2 3)
LAR (STRLEN AR))
(cond ( (> LAR 7)
(setq a:1 (substr ar 1 (- lar 7)) a:2 (substr ar (lar 6)))
(setq ar (strcat a:1 "," a:2)) ))
(setq t1 "SUPERFICIE = ") (setq t2 " m2.")
(setq SUP (STRCAT t1 ar t2))
(command "TEXT" "mc" (list (- x_y (* 28 tt)) (yi_c e_t ttv)) TTV "" SUP)
(setq S_C (entlast)) (command "change" S_C
"" "p" "c" "4" "")
(command "text" "c" (list (- x_y (* 28 tt)) (+
ym_c (* tt 8)))
TTV "" "CUADRO DE CONSTRUCCION")
(setq S_C (entlast)) (command "change" S_C
"" "p" "c" "4" "")
(setq yt_m (+ ym_c (* tt 4)))
(command "text" "mc" (list xi_c yt_m) tt ""
"EST.")
(command "text" "mc" (list x_pv yt_m) tt ""
"P.V.")
(command "text" "mr" (list x_d yt_m) tt ""
"DISTANCIA")
(command "text" "mr" (list x_r yt_m) tt "" "R U
M B O")
(command "text" "mc" (list x_v yt_m) tt "" "V")
(command "text" "C" (list (+ x_v (* 12 TT)) (+
yt_m (* 0.5 TT)))
tt "" "COORDENADAS")
(command "text" "TC" (list (+ x_v (* 7 TT)) (yt_m (* 0.5 TT)))
tt "" "X")
(command "text" "TC" (list (+ x_v (* 17 TT)) (yt_m (* 0.5 TT)))
tt "" "Y")
;dibujo de la mascara del cuadro
(setq xsi_m (- xi_c (* tt 3)) ysi_m (+ ym_c (* tt
6)))
(setq xid_m (+ x_y (* 2 tt)) yid_m (- yi_c tt))
(setq p1_m (list xsi_m ysi_m) p2_m (list xid_m
ysi_m))
(setq p3_m (list xid_m yid_m) p4_m (list xsi_m
yid_m))
(setq p5_m (list xsi_m (+ ym_c (* tt 2))) p6_m
(list xid_m (+ ym_c (* tt 2))))
(command "layer" "s" "masc" "")
(command "line" (list (+ xsi_m (* 5 tt)) ysi_m)
(list (+ xsi_m (* 5 tt)) yid_m) "")
(command "line" (list (+ xsi_m (* 10 tt)) ysi_m)
(list (+ xsi_m (* 10 tt)) yid_m) "")
(command "line" (list (+ xsi_m (* 20 tt)) ysi_m)
(list (+ xsi_m (* 20 tt)) yid_m) "")
(command "line" (list (+ xsi_m (* 35 tt)) ysi_m)
(list (+ xsi_m (* 35 tt)) yid_m) "")
(command "line" (list (+ xsi_m (* 40 tt)) ysi_m)
(list (+ xsi_m (* 40 tt)) yid_m) "")
(command "line" (list (+ xsi_m (* 50 tt)) (ysi_m (* 2 tt)))
(list (+ xsi_m (* 50 tt)) yid_m) "")
(command "line" (list (+ xsi_m (* 40 tt)) (ysi_m (* 2 tt)))
(list (+ xsi_m (* 60 tt)) (- ysi_m (* 2 tt))) "")
(command "line" p5_m p6_m "")
(command "change" "last" "" "p" "c" "4" "")
(command "pline" p1_m p2_m p3_m P4_m "C"
"") (setq f_p (* 1.5 tt))
(command "change" "last" "" "p" "c" "4" "")
(command "fillet" "r" f_p) (command "fillet" "p"
"last")
(setvar "blipmode" 0) (setvar "cmdecho" 1)
)
Alfonso
TODO ESO
Y LUEGO YA HACEN LOS PASOS DEL 1 AL
CUATRO QUE LES MENCIONE ANTES
SALUDOS
COMENTEN SI PUDIERON
9:53
Carlos
Conversación de chat finalizada
Visto por Alfonso, LuMan y Aristobolo
jóvenes de mis pendientes es lo referente
al cuadro de construccion de su poligonal
en autocad
1.- hacer su poligonal con el comando
3dpoly
2.- teclear la palabra "cuadro"
3.-se hacen indicaciones para
dimensionar el cuadro de construccion
4.- se selecciona la polilínea y
automáticamente hace el cuadro de
construcción.
si hay dudas espero sus comentarios
Escribe un mensaje...