- (defun c:ttt ()
- (initget (+ 2 4))
- (Setq x (getreal "\n输入X值:"))
- (initget (+ 2 4))
- (Setq y (getreal "\n输入Y值:")
- pt (getpoint "\n点选中心点:")
- )
- (SETQ PT1 (mapcar '+ (list (/ x -2) 0 0) (list 0 (/ y 2) 0) PT)
- PT2 (mapcar '+ (list (/ x 2) 0 0) (list 0 (/ y 2) 0) PT)
- PT3 (mapcar '+ (list (/ x 2) 0 0) (list 0 (/ y -2) 0) PT)
- PT4 (mapcar '+ (list (/ x -2) 0 0) (list 0 (/ y -2) 0) PT)
- LST (list pt1 pt2 pt3 pt4 pt1)
- lst2 (list 0 -1 0 -1 0)
- )
- (entmake (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 90 (length lst)))
- (apply 'append (mapcar '(lambda (x) (if (listp x) x (list x))) (mapcar '(lambda (a b)(list (cons 10 a) (cons 42 b))) lst lst2))))
- )
- )
简单来一下,自己可以再深入写一下图层之类的。
|