本人编写的CAD自动分图程序,但是加载CAD后运行不了,请高手们给指点指点!!谢谢大家了!!急用!!! (setq t1 (getpoint "\n拾取起始点:")) (setq t3 (getcorner t1 "\n拾取t的对角点:")) (setq t2 (list(car t3) (cdr t1))) (setq t4 (list(car t1) (cdr t3))) (command"line" t1 t2 t3 t4 "c") (setq chang (distance t1 t2)) (setq kuan (distance t2 t3)) (setq chang (- (car t2) (car t1))) (setq kuan(- (cdr t2) (cdr t3))) (if(< kuan 474000) (setq n1 (rtos (+ (/ chang 420000) 1 ) 2 0 ))) (setq i 1) (setq x1 (car t1)) (setq y1 (cdr t1)) (repeat n1 (PROGN (setq x1i (+ xi 420000)) (setq y1i (- yi 474000)) (setq xiyi (list xi yi)) (command"osnap" "off") (setq s (ssget "w" (xi yi) (x1i y1i))) (setq th 0) (setq xxx 0) (setq name (ssname s 0)) (setq a (entget name)) (setq tt (assol 0 a)) (setq tt (car t1)) (if (=tt "text") (PROGN (setq tx (assol a)) (setq tx (cdr tx)) (setq llen (strlen tx)) (setq tx1 (substr tx 1 llen )) )) (while (/=xxx nil)) (if (<th 10)(setq thh (strcat "0" (rtos th 2 0 )))) (if (>=th 10)(setq thh (rtos th 2 0 )))) (setq namel (strcat tx1 thh)) (setq th (+ th 1)) (setq p1 xiyi) (setq xxx p1 ) (if (/=p1 nil)(PROGN (setq p2 x1iy1i) (setq mmm (strcat "e:/fengtu /""A3""namel")) (command "wblak" mmm "p1" w "p1 p2") (command "oops") (setq xi (+ xi 420000)) )) (if( and (< kuan 474000) (< kuan 700000) (setq n2 (rtos (+ (/ chang 758000) 1 ) 2 0))) (setq i 1) (setq x1 (car t1)) (setq y1 (cdr t1)) (repeat n1 (PROGN (setq x1i (+ xi 758000)) (setq y1i (- yi 700000)) (setq xiyi (list xi yi)) (command"osnap" "off") (setq s (ssget "w" (xi yi) (x1i y1i))) (setq th 0) (setq xxx 0) (setq name (ssname s 0)) (setq a (entget name)) (setq tt (assol 0 a)) (setq tt (car t1)) (if (=tt "text") (PROGN (setq tx (assol a)) (setq tx (cdr tx)) (setq llen (strlen tx)) (setq tx1 (substr tx 1 llen )) )) (while (/=xxx nil)) (if (<th 10)(setq thh (strcat "0" (rtos th 2 0 )))) (if (>=th 10)(setq thh (rtos th 2 0 )))) (setq namel (strcat tx1 thh)) (setq th (+ th 1)) (setq p1 xiyi) (setq xxx p1 ) (if (/=p1 nil)(PROGN (setq p2 x1iy1i) (setq mmm (strcat "e:/fengtu /""A3""namel")) (command "wblak" mmm "p1" w "p1 p2") (command "oops") (setq xi (+ xi 420000)) )) (if(and (< kuan 700000) (<kuan 1046000) (setq n3 (rtos (+ (/ chang 1452000) 1 ) 2 0))) (setq i 1) (setq x1 (car t1)) (setq y1 (cdr t1)) (repeat n1 (PROGN (setq x1i (+ xi 1452000)) (setq y1i (- yi 1046000)) (setq xiyi (list xi yi)) (command"osnap" "off") (setq s (ssget "w" (xi yi) (x1i y1i))) (setq th 0) (setq xxx 0) (setq name (ssname s 0)) (setq a (entget name)) (setq tt (assol 0 a)) (setq tt (car t1)) (if (=tt "text") (PROGN (setq tx (assol a)) (setq tx (cdr tx)) (setq llen (strlen tx)) (setq tx1 (substr tx 1 llen )) )) (while (/=xxx nil)) (if (<th 10)(setq thh (strcat "0" (rtos th 2 0 )))) (if (>=th 10)(setq thh (rtos th 2 0 )))) (setq namel (strcat tx1 thh)) (setq th (+ th 1)) (setq p1 xiyi) (setq xxx p1 ) (if (/=p1 nil)(PROGN (setq p2 x1iy1i) (setq mmm (strcat "e:/fengtu /""A3""namel")) (command "wblak" mmm "p1" w "p1 p2") (command "oops") (setq xi (+ xi 420000)) )) (if(and (<kuan 1046000) (< kwan 1540000) (setq n4 (rtos (+ (/ chang 1948000) 1 ) 2 0))) (setq i 1) (setq x1 (car t1)) (setq y1 (cdr t1)) (repeat n1 (PROGN (setq x1i (+ xi 1948000)) (setq y1i (- yi 1540000)) (setq xiyi (list xi yi)) (command"osnap" "off") (setq s (ssget "w" (xi yi) (x1i y1i))) (setq th 0) (setq xxx 0) (setq name (ssname s 0)) (setq a (entget name)) (setq tt (assol 0 a)) (setq tt (car t1)) (if (=tt "text") (PROGN (setq tx (assol a)) (setq tx (cdr tx)) (setq llen (strlen tx)) (setq tx1 (substr tx 1 llen )) )) (while (/=xxx nil)) (if (<th 10)(setq thh (strcat "0" (rtos th 2 0 )))) (if (>=th 10)(setq thh (rtos th 2 0 )))) (setq namel (strcat tx1 thh)) (setq th (+ th 1)) (setq p1 xiyi) (setq xxx p1 ) (if (/=p1 nil)(PROGN (setq p2 x1iy1i) (setq mmm (strcat "e:/fengtu /""A3""namel")) (command "wblak" mmm "p1" w "p1 p2") (command "oops") (setq xi (+ xi 420000)) )) (if( > kuan 1540000) (PROGN (setq n5 (rtos (/ kuan 2) 2 0) (setq x0 (car t1)) (setq y1 (cdr t1)) (setq y0 (- y1 n5)) (setq t0 (list x0 y0)) (setq y11 (+ y0 974000)) (setq t11 (list x0 y11)) (setq x12 (+ X0 1948000)) (setq t12 (list x12 y11)) (setq y13 (- y11 1546000)) (setq t13 (list x12 y13)) (setq t14 (list x0 y13)) (command "line" t11 t12 t13 t14 "c") (setq i 1) (setq x1 (car t1)) (setq y1 (cdr t1)) (repeat n1 (PROGN (setq x1i (+ xi 1948000)) (setq y1i (- yi 1540000)) (setq xiyi (list xi yi)) (command"osnap" "off") (setq s (ssget "w" (xi yi) (x1i y1i))) (setq th 0) (setq xxx 0) (setq name (ssname s 0)) (setq a (entget name)) (setq tt (assol 0 a)) (setq tt (car t1)) (if (=tt "text") (PROGN (setq tx (assol a)) (setq tx (cdr tx)) (setq llen (strlen tx)) (setq tx1 (substr tx 1 llen )) )) (while (/=xxx nil)) (if (<th 10)(setq thh (strcat "0" (rtos th 2 0 )))) (if (>=th 10)(setq thh (rtos th 2 0 )))) (setq namel (strcat tx1 thh)) (setq th (+ th 1)) (setq p1 xiyi) (setq xxx p1 ) (if (/=p1 nil)(PROGN (setq p2 x1iy1i) (setq mmm (strcat "e:/fengtu /""A3""namel")) (command "wblak" mmm "p1" w "p1 p2") (command "oops") (setq xi (+ xi 420000)) |