红色总面积值除以黑色面积值?-->0.238058 ?? 或者反过来?4.20066 ??
- (defun c:demo ( / _total ss ssd TareaRed TareaBlack ComputedArea)
- (defun _total (sel / Value)
- (repeat (setq i (sslength sel))
- (setq Value (cons (vlax-curve-getarea (ssname sel (setq i (1- i)))) Value)))
- (apply '+ Value)
- )
- (defun _Rtos (v)(rtos v 2 2))
-
-
- (if (and (princ "\nSelect RED pline(s)")
- (setq ss (ssget '((0 . "LWPOLYLINE"))))
- (princ "\nSelect Black pline")
- (setq ssD (ssget '((0 . "LWPOLYLINE"))))
- )
- (progn
- (setq TareaRed (_total ss))
- (setq TareaBlack (_total ssd))
- (setq ComputedArea ( / TareaRed TareaBlack))
- (alert (strcat "\nTotal area for RED pline(s): " (_rtos TareaRed )
- "\nTotal area for BLACK pline(s): " (_rtos TareaBlack )
- "\nTotal RED divided by BLACK: " (_rtos ComputedArea)
- "\nPercentage: " (_rtos (* 100.00 ComputedArea)) "%"))
- )
- )
- (princ)
- )
-
|