我需要将选定实体的颜色也更改为青色。我试着用:
- (command "_.chprop" (s) "" "color" "CYAN" "")
但不起作用。据我所知,您将所选实体的“名称”存储在“s”中。Entlast还返回最后添加的实体的“名称”,因此它应该可以工作,但可能是不兼容的数据类型?
编辑:哦,没关系,我明白了,我不需要括号。现在可以工作了。谢谢。
编辑2:修复末尾缺少的paren。
- (defun c:TesT (/ s d p)
- (vl-load-com)
- ;;; Tharwat 24. Feb. 2012 ;;;
- (if
- (and
- (setq s (car (entsel "\n Select entity :")))
- (member (cdr (assoc 0 (entget s)))
- '("LWPOLYLINE" "POLYLINE" "LINE" "CIRCLE" "ARC" "ELLIPSE")
- )
- (setq d (getdist "\n Distance of offset :"))
- (setq p (getpoint "\n Specify point on side to offset :"))
- )
- (progn
- (command "_.offset" d s p "")
- (command "_.chprop" s "" "color" "CYAN" "")
- (command "_.chprop" (entlast) "" "color" "WHITE" "")
- (command "_.offset" (+ d d) s p "")
- (command "_.chprop" (entlast) "" "color" "CYAN" "")
- )
- (princ)
- )
- (princ)
- )
|