Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun c:q ()
- (setq X "0" Y "0" w_n 2 a 4 r 0 r1 0 r2 "0" slo "0" rt 0 isp "" prov "" data_isp "" data_prov "" naz "" kod "" mas "" listt "" mesto "" listov "")
- (setq dcl_id (load_dialog "d:\\q.dcl"))
- (while (> w_n 0) (run))
- (start_dialog)
- (unload_dialog dcl_id)
- )
- (defun w ()
- (if(not(new_dialog "w" dcl_id)) (exit))
- (action_tile "file" "(stamp)")
- (action_tile "isp" "(setq isp $value)") (set_tile "isp" isp)
- (action_tile "prov" "(setq prov $value)") (set_tile "prov" prov)
- (action_tile "data_isp" "(setq data_isp $value)") (set_tile "data_isp" data_isp)
- (action_tile "data_prov" "(setq data_prov $value)") (set_tile "data_prov" data_prov)
- (action_tile "kod" "(setq kod $value)") (set_tile "kod" kod)
- (action_tile "mas" "(setq mas $value)") (set_tile "mas" mas)
- (action_tile "listt" "(setq listt $value)") (set_tile "listt" listt)
- (action_tile "listov" "(setq listov $value)") (set_tile "listov" listov)
- (action_tile "mesto" "(setq mesto $value)") (set_tile "mesto" mesto)
- (action_tile "naz" "(setq naz $value)") (set_tile "naz" naz)
- (start_dialog)
- )
- (defun run ()
- (if (not (new_dialog "q" dcl_id) ) (exit))
- (action_tile "stamp" "(w)")
- (action_tile "bt_ok" "(done_dialog 1)")
- (action_tile "bt_cancel" "(exit)")
- (action_tile "color" "(done_dialog 3)")
- (action_tile "dot" "(done_dialog 4)")
- (action_tile "edx" "(setq X $value)")
- (action_tile "edy" "(setq Y $value)")
- (set_tile "edx" X)
- (set_tile "edy" Y)
- (action_tile "a0" "(setq A 0)") (if (= A 0) (set_tile "a0" "1"))
- (action_tile "a1" "(setq A 1)") (if (= A 1) (set_tile "a1" "1"))
- (action_tile "a2" "(setq A 2)") (if (= A 2) (set_tile "a2" "1"))
- (action_tile "a3" "(setq A 3)") (if (= A 3) (set_tile "a3" "1"))
- (setq n_sloi (tblnext "LAYER" T))
- (setq rt 1)
- (while (not (= (setq ent (tblnext "layer")) nil))
- (setq rt (+ rt 1))
- )
- (setq n_sloi (tblnext "LAYER" T))
- (setq a_sloi (nth 1 n_sloi))
- (setq name_sloi (cdr a_sloi))
- (setq list_sloi (list name_sloi))
- (repeat (- rt 1)
- (setq n_sloi (tblnext "LAYER"))
- (setq a_sloi (nth 1 n_sloi))
- (setq name_sloi (cdr a_sloi))
- (setq list_sloi (cons name_sloi list_sloi))
- )
- (setq list_sloi (reverse list_sloi))
- (setq k 0)
- (start_list "sloi")
- (repeat rt
- (add_list (nth k list_sloi))
- (setq k (+ k 1))
- )
- (end_list)
- (action_tile "sloi" "(setq slo $value)") (set_tile "sloi" slo)
- (action_tile "stamp1" "(or (if (= r 0) (setq r 1)) (if (= r 1) (setq r 0)))") (if (= r 1) (set_tile "stamp1" "1"))
- (action_tile "spec" "(or (if (= r1 0) (setq r1 1)) (if (= r1 1) (setq r1 0)))") (if (= r1 1) (set_tile "spec" "1"))
- (action_tile "ramka" "(and (setq r2 $value) (mode_tile \"format\" (- 1 (atoi $value))))") (cond
- ((= r2 "0") (and (set_tile "ramka" "0") (mode_tile "format" 1)))
- ((= r2 "1") (and (set_tile "ramka" "1") (mode_tile "format" 0)))
- )
- (setq w_n (start_dialog))
- (cond
- ((= w_n 4) (tochka))
- ((= w_n 1) (progn
- (setq slo1 (atoi slo))
- (setq slo2 (nth slo1 list_sloi))
- (command "_layer" "_set" slo2)
- (command *cancel*)
- (if (= r 1) (progn
- (draw_stamp)
- (draw_text)
- ))
- (if (= r1 1) (draw_spec))
- (if (= r2 "1") (draw_ramka))
- (setq w_n 0)
- ))
- ((= w_n 3) (getcolor))
- )
- )
- (defun tochka ()
- (setq pt (getpoint "\n Укажите точку на экране \n"))
- (setq X (rtos (car pt) 2 3))
- (setq Y (rtos (cadr pt) 2 3))
- )
- (defun getcolor ()
- (setq num_color (atoi (getvar "cecolor")))
- (setq num_color (acad_colordlg num_color))
- (command "_color" num_color)
- )
- (defun stamp ()
- (setq f (open "d:\\e.txt" "r"))
- (setq isp (read-line f)) (set_tile "isp" isp)
- (setq prov (read-line f)) (set_tile "prov" prov)
- (setq data_isp (read-line f)) (set_tile "data_isp" data_isp)
- (setq data_prov (read-line f)) (set_tile "data_prov" data_prov)
- (setq kod (read-line f)) (set_tile "kod" kod)
- (setq mas (read-line f)) (set_tile "mas" mas)
- (setq listt (read-line f)) (set_tile "listt" listt)
- (setq listov (read-line f)) (set_tile "listov" listov)
- (setq mesto (read-line f)) (set_tile "mesto" mesto)
- (setq naz (read-line f)) (set_tile "naz" naz)
- (close f)
- )
- (defun draw_ramka ()
- (setq z1 (list (atoi x) (atoi y)))
- (cond
- ((= a 0) (command "_.rectang" z1 "@1189,841"))
- ((= a 1) (command "_.rectang" z1 "@841,594"))
- ((= a 2) (command "_.rectang" z1 "@594,420"))
- ((= a 3) (command "_.rectang" z1 "@420,297"))
- )
- (setq w_n 0)
- )
- (defun draw_text ()
- (cond
- ((= a 0) (setq v (+ (atoi x) 1022) b (+ (atoi y) 26) n (+ (atoi x) 1059) m (+ (atoi y) 21) c (+ (atoi x) 1080) k (+ (atoi y) 31) t (+ (atoi x) 1096) t1 (+ (atoi y) 44) u (+ (atoi x) 1175) u1 (+ (atoi x) 1139) l (+ (atoi x) 1142) l1 (+ (atoi y) 5) ff (+ (atoi x) 1177) ff1 (+ (atoi y) 16) ) )
- ((= a 1) (setq v (+ (atoi x) 674) b (+ (atoi y) 26) n (+ (atoi x) 711) m (+ (atoi y) 21) c (+ (atoi x) 732) k (+ (atoi y) 31) t (+ (atoi x) 748) t1 (+ (atoi y) 44) u (+ (atoi x) 827) u1 (+ (atoi x) 791) l (+ (atoi x) 794) l1 (+ (atoi y) 5) ff (+ (atoi x) 829) ff1 (+ (atoi y) 16) ) )
- ((= a 2) (setq v (+ (atoi x) 427) b (+ (atoi y) 26) n (+ (atoi x) 464) m (+ (atoi y) 21) c (+ (atoi x) 485) k (+ (atoi y) 31) t (+ (atoi x) 501) t1 (+ (atoi y) 44) u (+ (atoi x) 580) u1 (+ (atoi x) 544) l (+ (atoi x) 547) l1 (+ (atoi y) 5) ff (+ (atoi x) 582) ff1 (+ (atoi y) 16) ) )
- ((= a 3) (setq v (+ (atoi x) 253) b (+ (atoi y) 26) n (+ (atoi x) 290) m (+ (atoi y) 21) c (+ (atoi x) 311) k (+ (atoi y) 31) t (+ (atoi x) 327) t1 (+ (atoi y) 44) u (+ (atoi x) 406) u1 (+ (atoi x) 370) l (+ (atoi x) 373) l1 (+ (atoi y) 5) ff (+ (atoi x) 408) ff1 (+ (atoi y) 16) ) )
- ((= a 4) (setq v (+ (atoi x) 18) b (+ (atoi y) 26) n (+ (atoi x) 55) m (+ (atoi y) 21) c (+ (atoi x) 76) k (+ (atoi y) 31) t (+ (atoi x) 92) t1 (+ (atoi y) 44) u (+ (atoi x) 171) u1 (+ (atoi x) 135) l (+ (atoi x) 138) l1 (+ (atoi y) 5) ff (+ (atoi x) 173) ff1 (+ (atoi y) 16) ) )
- )
- (setq isp1 (list v b))
- (setq data_isp1 (list n b))
- (setq prov1 (list v m))
- (setq data_prov1 (list n m))
- (setq naz1 (list c k))
- (setq kod1 (list t t1))
- (setq mas1 (list u b))
- (setq listt1 (list u1 b))
- (setq mesto1 (list l l1))
- (setq listov1 (list ff ff1))
- (command "_.text" isp1 "2.5" "0" isp)
- (command "_.text" data_isp1 "2.5" "0" data_isp)
- (command "_.text" prov1 "2.5" "0" prov)
- (command "_.text" data_prov1 "2.5" "0" data_prov)
- (command "_.text" naz1 "5" "0" naz)
- (command "_.text" kod1 "7" "0" kod)
- (command "_.text" mas1 "4" "0" mas)
- (command "_.text" listt1 "4" "0" listt)
- (command "_.text" mesto1 "4" "0" mesto)
- (command "_.text" listov1 "3.5" "0" listov)
- (setq w_n 0)
- )
- (defun draw_stamp ()
- (cond
- ((= a 0) (setq j (+ (atoi x) 1004) j1 (+ (atoi x) 1005) j2 (+ (atoi y) 26) j3 (+ (atoi y) 21) j4 (+ (atoi y) 31) b1 (+ (atoi x) 1139) b2 (+ (atoi y) 36) b3 (+ (atoi y) 16) ) )
- ((= a 1) (setq j (+ (atoi x) 656) j1 (+ (atoi x) 657) j2 (+ (atoi y) 26) j3 (+ (atoi y) 21) j4 (+ (atoi y) 31) b1 (+ (atoi x) 791) b2 (+ (atoi y) 36) b3 (+ (atoi y) 16) ) )
- ((= a 2) (setq j (+ (atoi x) 409) j1 (+ (atoi x) 410) j2 (+ (atoi y) 26) j3 (+ (atoi y) 21) j4 (+ (atoi y) 31) b1 (+ (atoi x) 544) b2 (+ (atoi y) 36) b3 (+ (atoi y) 16) ) )
- ((= a 3) (setq j (+ (atoi x) 235) j1 (+ (atoi x) 236) j2 (+ (atoi y) 26) j3 (+ (atoi y) 21) j4 (+ (atoi y) 31) b1 (+ (atoi x) 370) b2 (+ (atoi y) 36) b3 (+ (atoi y) 16) ) )
- ((= a 4) (setq j (atoi x) j1 (+ (atoi x) 1) j2 (+ (atoi y) 26) j3 (+ (atoi y) 21) j4 (+ (atoi y) 31) b1 (+ (atoi x) 135) b2 (+ (atoi y) 36) b3 (+ (atoi y) 16) ) )
- )
- (setq s1 (list j (atoi y)))
- (setq raz (list j1 j2))
- (setq prover (list j1 j3))
- (setq word (list j1 j4))
- (setq word1 (list b1 b2))
- (setq word2 (list b1 b3))
- (command "_.text" raz "2.5" "0" "Разраб.")
- (command "_.text" prover "2.5" "0" "Пров.")
- (command "_.text" word "2.5" "0" "Изм. Лист № докум. Подп. Дата")
- (command "_.text" word1 "2.5" "0" " Лит. Масса Масштаб")
- (command "_.text" word2 "2.5" "0" " Лист Листов")
- (command "_.rectang" s1 "@185,55")
- (command "_.rectang" s1 "@65,5")
- (command "_.rectang" s1 "@65,10")
- (command "_.rectang" s1 "@65,15")
- (command "_.rectang" s1 "@65,20")
- (command "_.rectang" s1 "@65,25")
- (command "_.rectang" s1 "@65,30")
- (command "_.rectang" s1 "@65,35")
- (command "_.rectang" s1 "@65,40")
- (command "_.rectang" s1 "@65,45")
- (command "_.rectang" s1 "@65,50")
- (command "_.rectang" s1 "@65,55")
- (command "_.rectang" s1 "@17,55")
- (command "_.rectang" s1 "@40,55")
- (command "_.rectang" s1 "@55,55")
- (command "_.rectang" s1 "@65,55")
- (command "_.rectang" s1 "@185,15")
- (command "_.rectang" s1 "@185,40")
- (command "_.rectang" s1 "@135,40")
- (command "_.line" s1 "@0,55" "@7,0" "@0,-25" "@-7,0" "_c")
- (command "_.line" s1 "@135,0" "@0,20" "@50,0" "@0,20" "@-50,0" "@0,-20" "@20,0" "@0,-5" "@30,0" "@0,20" "@-50,0" "@5,0" "@0,-15" "@5,0" "@0,15" "@5,0" "@0,5" "@0,-20" "@17,0" "@0,20" "@18,0" "@0,-40" "_c")
- (setq w_n 0)
- )
- (defun draw_spec ()
- (cond
- ((= a 0) (setq g (+ (atoi x) 1219) h (+ (atoi y) 40)) )
- ((= a 1) (setq g (+ (atoi x) 871) h (+ (atoi y) 40)) )
- ((= a 2) (setq g (+ (atoi x) 624) h (+ (atoi y) 40)) )
- ((= a 3) (setq g (+ (atoi x) 450) h (+ (atoi y) 40)) )
- ((= a 4) (progn
- (if (= r 1) (setq g (+ (atoi x) 215) h (+ (atoi y) 40)) )
- (if (= r 0) (setq g (atoi x) h (+ (atoi y) 40)) )
- ))
- )
- (setq d1 (list g h))
- (command "_.rectang" d1 "@185,8")
- (command "_.rectang" d1 "@185,16")
- (command "_.rectang" d1 "@185,24")
- (command "_.rectang" d1 "@185,32")
- (command "_.rectang" d1 "@185,40")
- (command "_.rectang" d1 "@185,48")
- (command "_.rectang" d1 "@185,56")
- (command "_.rectang" d1 "@185,64")
- (command "_.rectang" d1 "@185,72")
- (command "_.rectang" d1 "@185,80")
- (command "_.rectang" d1 "@185,88")
- (command "_.rectang" d1 "@185,96")
- (command "_.rectang" d1 "@185,104")
- (command "_.rectang" d1 "@185,112")
- (command "_.rectang" d1 "@185,120")
- (command "_.rectang" d1 "@185,128")
- (command "_.rectang" d1 "@185,136")
- (command "_.rectang" d1 "@185,144")
- (command "_.rectang" d1 "@185,152")
- (command "_.rectang" d1 "@185,160")
- (command "_.rectang" d1 "@185,168")
- (command "_.rectang" d1 "@185,176")
- (command "_.rectang" d1 "@185,184")
- (command "_.rectang" d1 "@185,192")
- (command "_.rectang" d1 "@185,200")
- (command "_.rectang" d1 "@185,208")
- (command "_.rectang" d1 "@185,216")
- (command "_.rectang" d1 "@185,224")
- (command "_.rectang" d1 "@185,232")
- (command "_.rectang" d1 "@185,240")
- (command "_.rectang" d1 "@185,255")
- (command "_.rectang" d1 "@140,255")
- (command "_.rectang" d1 "@130,255")
- (command "_.rectang" d1 "@20,255")
- (command "_.rectang" d1 "@65,-5")
- (command "_.rectang" d1 "@65,-10")
- (command "_.rectang" d1 "@65,-15")
- (command "_.rectang" d1 "@65,-20")
- (command "_.rectang" d1 "@65,-25")
- (command "_.rectang" d1 "@65,-30")
- (command "_.rectang" d1 "@65,-35")
- (command "_.rectang" d1 "@65,-40")
- (command "_.rectang" d1 "@55,-40")
- (command "_.rectang" d1 "@40,-40")
- (command "_.rectang" d1 "@17,-40")
- (command "_.rectang" d1 "@7,-15")
- (command "_.rectang" d1 "@185,-15")
- (command "_.rectang" d1 "@185,-40")
- (command "_.line" d1 "@185,0" "@0,-20" "@-50,0" "@0,-5" "@5,0" "@0,5" "@5,0" "@0,-5" "@-5,0" "@10,0" "@0,10" "@15,0" "@0,-10" "@20,0" "@-50,0" "@0,10" "@0,-25" "@-135,0" "_c")
- (setq w_n 0)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement