以下是一些让您开始学习的内容:
- (defun c:test (/ *error* ss cnt)
- (defun *error* (msg)
- (if (not
- (member msg '("Function cancelled" "quit / exit abort"))
- )
- (princ (strcat "\nError: " msg))
- )
- (princ)
- )
- (setq ss (ssget "_X")
- cnt 0)
- (repeat (sslength ss)
- (setq obj (vlax-ename->vla-object (ssname ss cnt)))
- ;;;Need to check if block is an xref or a layout and if so, ignore rest of code
- ;;;Use an if or statement or an if and statement to do this
- (if (= (vla-get-truecolor obj) colortype)
- (vla-put-truecolor obj desiredcolor)
- )
- (setq cnt (+ cnt 1))
- )
- )
|