本帖最后由 Gu_xl 于 2013-4-10 11:55 编辑
- ;;(gxl-makewipeout pts) 绘制WipeOut By Gu_xl
- ;;用法: (gxl-makewipeout (list (getpoint "\n点:") (getpoint "\n点:") (getpoint "\n点:") (getpoint "\n点:")))
- (defun gxl-makewipeout (PTS / LL UR wh w h CP LST ANG)
- (if (not (member "acwipeout.arx" (arx)))
- (ARXLOAD "acwipeout.arx")
- )
- (if (not (equal (car pts) (last pts) 1e-6))
- (setq pts (cons (last pts) pts))
- )
- (setq ll (apply 'mapcar (cons 'min pts))
- ur (apply 'mapcar (cons 'max pts))
- wh (mapcar '- ur ll)
- w (car wh)
- h (cadr wh)
- cp (mapcar '* (mapcar '+ ll ur) '(0.5 0.5 0.5))
- )
- (foreach pt pts
- (setq lst (cons (list 14
- (/ (car (setq pt (mapcar '- pt cp))) w)
- (- (/ (cadr pt) h))
- )
- lst
- )
- )
- )
- (setq lst (reverse lst))
- (entmakex
- (append
- (list
- '(0 . "WIPEOUT")
- '(100 . "AcDbEntity")
- '(100 . "AcDbWipeout")
- (cons 10 ll)
- (list 11 w 0.0)
- (list 12 0.0 h)
- '(280 . 1)
- '(71 . 2)
- )
- lst
- )
- )
- )
|