- ;根据角度改直线颜色
- (defun c:xx (/ ang1 ang2 i s1 s2 ss ss2)
- (xx-coma)
- (xx-princa "改角度相等的直线颜色")
- (xx-princ "直线对象")
- (setq s1 (xx-e2o (car (xx-get-entsel '((0 . "LINE")) "直线"))))
- (setq ang1 (vla-get-angle s1)) ; 提取线的角度
- (if (setq ss (ssget '((0 . "LINE"))))
- (progn
- (setq i -1)
- (while (setq s2 (ssname ss (setq i (1+ i))))
- (setq ss2 (xx-e2o s2)
- ang2 (vla-get-angle ss2)
- )
- (if (= ang1 ang2)
- (vla-put-color ss2 1) ; 替换对象颜色
- )
- )
- )
- )
- (xx-comb)
- )
|