人家给了编程思路了,给你个画wipeout的代码,其它包围盒、提取块内图元且列表、删除块内图元,添加图元什么的代码论坛有。- ;; CAB - Jan. 3,2010 to present
- (defun MkWipeout(lst / c m p)
- (setq lst (cons (last lst) lst)
- p (apply 'mapcar (cons 'min lst))
- m (apply 'max (mapcar '- (apply 'mapcar (cons 'max lst)) p))
- c (mapcar '+ p (list (/ m 2.0) (/ m 2.0)))
- )
- (entmakex
- (append (list '(000 . "WIPEOUT")
- '(100 . "AcDbEntity")
- '(100 . "AcDbWipeout")
- (cons 10 (trans p 1 0))
- (cons 11 (trans (list m 0.0) 1 0))
- (cons 12 (trans (list 0.0 m) 1 0))
- '(280 . 1)
- '(071 . 2)
- )
- (mapcar
- (function
- (lambda (x)
- (cons 14
- (mapcar '(lambda (a b c) (/ (- a b) c))
- x
- c
- (list m (- m))
- )
- )
- )
- )
- lst
- )
- )
- )
- )
- ;;真彩色的含义
- ;;(+ (* BLUE 65536) (* GREEN 256) RED)
- ;;(+ (* 255 65536) (* 255 256) 255)=16777215
|