本帖最后由 菜卷鱼 于 2020-5-16 10:41 编辑
背景颜色切换, 是我CAD 问题还是 代码错了 ,不能切换 自动追踪矢量线的颜色。?
由于自动追踪矢量线颜色无法如预期切换,背景白色的时候,看不到矢量线,背景黑色的时候可以看到。
 - ;;;切换背景颜色 ,十字光标颜色 ,自动追踪矢量线颜色
- (defun c:bkex (/ DISPLAY whitecol blackcol)
- (setq DISPLAY (vla-get-display
- (vla-get-preferences
- (vla-get-application (vlax-get-acad-object))
- )
- )
- )
- (setq whitecol (vlax-make-variant 16777215 19))
- (setq blackcol (vlax-make-variant 0 19))
- (cond
- (
- (equal (vla-get-GraphicsWinModelBackgrndColor DISPLAY)
- whitecol
- )
- (vla-put-GraphicsWinModelBackgrndColor DISPLAY blackcol)
- (vla-put-ModelCrosshairColor DISPLAY whitecol)
- (vla-put-AutoTrackingVecColor DISPLAY whitecol)
- )
- (
- (equal (vla-get-GraphicsWinModelBackgrndColor DISPLAY)
- blackcol
- )
- (vla-put-GraphicsWinModelBackgrndColor DISPLAY whitecol)
- (vla-put-ModelCrosshairColor DISPLAY blackcol)
- (vla-put-AutoTrackingVecColor DISPLAY blackcol)
- )
- (T
- (vla-put-GraphicsWinModelBackgrndColor DISPLAY blackcol)
- (vla-put-ModelCrosshairColor DISPLAY whitecol)
- (vla-put-AutoTrackingVecColor DISPLAY whitecol)
- )
- )
- (princ "\n背景颜色已经切换。")
- (prin1)
- )
|