Change Modemacro color

Discussion in 'AutoCAD' started by CADwiesel, Apr 21, 2004.

  1. CADwiesel

    CADwiesel Guest

    Hi
    Since we can use vlisp, there are a lot of things possible.
    Now i am looking of an kind to change the color of shown Text, or background of the modemacro fieled.
    Perhaps there is an possibility?

    Thanks
     
    CADwiesel, Apr 21, 2004
    #1
  2. CADwiesel

    Jeff Mishler Guest

    Yes there is a possibility. Here are two lisp routines, one for the text
    window background color and another for the text window text color. To use,
    save the lisp as a .lsp file, load it with appload or add it to your startup
    suite, then in a button macro or at the command line use these commands:
    (set_txt_bkgrnd 1)
    (set_txt_foregrnd 6)

    Valid numbers to use without modifying the code are 1 through 7, which
    correspond to ACAD colors 1-7. Any other entry will result in black being
    used.

    Good Luck and have fun!

    Jeff

    ;|sub-routines to change text window background & text
    color(s). Autocad colors 1 - 7 are supported, any other
    number, or nil, will go to black. Other colors can be added,
    just make sure to convert from Autocad color to
    OLE_COLOR number first. May need to adjust
    text color as well.
    by Jeff Mishler, April 2004
    usage: (set_txt_bkgrnd 1) will set background to Red
    |;
    (defun set_txt_bkgrnd (color)
    (cond ((eq color 1)(setq color 255))
    ((eq color 2)(setq color 65535))
    ((eq color 3)(setq color 65280))
    ((eq color 4)(setq color 16776960))
    ((eq color 5)(setq color 16711680))
    ((eq color 6)(setq color 16711935))
    ((eq color 7)(setq color 16777215))
    (t(setq color 1))
    )
    (vla-put-TextWinBackgrndColor
    (vla-get-display
    (vla-get-Preferences
    (vlax-get-acad-object)
    )
    )
    color
    )
    )

    (defun set_txt_foregrnd (color)
    (cond ((eq color 1)(setq color 255))
    ((eq color 2)(setq color 65535))
    ((eq color 3)(setq color 65280))
    ((eq color 4)(setq color 16776960))
    ((eq color 5)(setq color 16711680))
    ((eq color 6)(setq color 16711935))
    ((eq color 7)(setq color 16777215))
    (t(setq color 1))
    )
    (vla-put-TextWinTextColor
    (vla-get-display
    (vla-get-Preferences
    (vlax-get-acad-object)
    )
    )
    color
    )
    )

    background of the modemacro fieled.
     
    Jeff Mishler, Apr 21, 2004
    #2
  3. Hi Jeff!
    ----------
    I think that evening and weariness caught
    you in the sticky fly-paper!!!

    He asks about MODEMACRO field in the status bar!!! ; )
    I fear it is not possible... but who knows...
     
    Alexander V. Koshman, Apr 21, 2004
    #3
  4. CADwiesel

    Jeff Mishler Guest

    Right you are!

    Oh well, it's not the first time I mis-read a post...and probably not the
    last.

    :)
    Jeff
     
    Jeff Mishler, Apr 21, 2004
    #4
  5. CADwiesel

    BillZ Guest

    eff,
    Just out of curiosity...
    Where do these numbers come from?
    255 65535 6528016776960 16711680 16711935 16777215

    They don't appear to be the regular RGB numbers.

    Bill
     
    BillZ, Apr 21, 2004
    #5
  6. CADwiesel

    Jeff Mishler Guest

    They are OLE color numbers.

    I've found these and many others in this and the MS newsgroups.

    Let's see, I know I saved a rather large list of these somewhere....lemme
    see if I can find it......

    *rustle* *shuffle* *knock over coffee cup* *phew, it was empty* *more paper
    shuffling*

    HMMM, well I couldn't find my saved copy but I did find a thread that I
    participated in and a few different conversions were posted.

    See the thread entitled "Text Background color to aci color" started by Russ
    Green on 12/7/03. Bobby Jones mentions a new way to do this in 2004 but
    since I don't have 2004 I can't comment.

    Jeff
     
    Jeff Mishler, Apr 21, 2004
    #6
  7. CADwiesel

    Jeff Mishler Guest

    OOPs, I guess I should've mentioned that the thread I referenced is in the
    customization.vba newsgroup.....
     
    Jeff Mishler, Apr 21, 2004
    #7
  8. CADwiesel

    BillZ Guest

    Thanks,

    I'll check it out.


    Bill
     
    BillZ, Apr 21, 2004
    #8
  9. CADwiesel

    CADwiesel Guest

    Thanks for your efforts.
    I'll hope, there will be an positive result ;D
     
    CADwiesel, Apr 22, 2004
    #9
  10. CADwiesel

    BillZ Guest

    <<< Reply From: Jeff Mishler
    Date: Apr/21/04 - 12:52 (CDT)
    Re: Change Modemacro color
    OOPs, I guess I should've mentioned that the thread I referenced is in the
    customization.vba newsgroup..... >>

    I guess that would make a difference. :)

    I found some conversion codes so I'll see what kind of hole I can dig myself into for a while.

    Thanks

    Bill
     
    BillZ, Apr 22, 2004
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.