;;http://free.ys168.com/?lucas-lai (defun C:Test (/ LST MAXPOINT MINPOINT point) (vla-getboundingbox (vlax-ename->vla-object (car (entsel))) 'MINPOINT 'MAXPOINT ) (setq LST (mapcar 'vlax-safearray->list (list MINPOINT MAXPOINT))) (setq MINPOINT(car lst) MAXPOINT(cadr lst) ) (setq point(list (car MAXPOINT) (cadr MINPOINT )(caddr MINPOINT)))
(setq LST (mapcar 'abs (mapcar '- (car LST) (cadr LST)))) (setq LST (list (list "长宽高" (strcat (rtos (car LST) 2 2) "X" (rtos (cadr LST) 2 2) "X" (rtos (last LST) 2 2) ) ) (list "体积" (rtos (* (car LST) (cadr LST) (last LST)) 2 2) ) ) ) ;;(TABLE_UTIL LST (getpoint "\n表格插入点: ") "standard" 20) (princ"\n右下角坐标为:") (princ point) (princ) ) |