- (vl-load-com)
- (setq *PLColor:ACI_Range* '(10 . 199)
- *PLColor:Z_Range* '(0.0 . 100.0))
- (defun PLColour:CalcColour (elevation / z aci)
- (setq z (- (cdr *PLColor:Z_Range*) (car *PLColor:Z_Range*) -1.0)
- z (/ (rem elevation z) z))
- (+ (car *PLColor:ACI_Range*) (fix (* (- (cdr *PLColor:ACI_Range*) (car *PLColor:ACI_Range*)) z))))
- (defun c:PLColour (/ ss n ed z eList minZ maxZ)
- (if (setq ss (ssget '((0 . "LWPOLYLINE"))))
- (progn (setq minZ 1.7976931348623158e308
- maxZ -1.7976931348623158e308)
- (repeat (setq n (sslength ss))
- (setq eList (cons (setq ed (entget (ssname ss (setq n (1- n))))) eList)
- z (cond ((cdr (assoc 38 ed))) (0.0))
- minZ (min z minZ)
- maxZ (max z maxZ)))
- (setq *PLColor:Z_Range* (cons minZ maxZ))
- (foreach ed eList
- (setq z (cond ((cdr (assoc 38 ed))) (0.0)))
- (entmod (list (assoc -1 ed) (cons 62 (PLColour:CalcColour z)))))))
- (princ))
仍然不起作用。
为了更好地理解,我附上了正在测试的文件。
cadforum_测试。图纸 |