MikeP Posted June 4, 2009 Author Posted June 4, 2009 Whats your CMDECHO set to? 0, when I set it to 1, it opens up the cmd window everytime i hit f12 Quote
MikeP Posted June 4, 2009 Author Posted June 4, 2009 Heres what Im using. If that could display the time in the modemacro upon timeoff that would be awsome. also, I noticed that when opening a drawing, either new or existing, it defaults the cmd box red yet the time starts as on. I want it to open the drawing as off. you can see I tried to put that in and it works. only annopying thing is that it opens the new command window everytime I open a drawing. how can i prevent it from opening the window and still defaulting the time as off and red ;; Command Line Colour Change by Lee McDonnell(defun CmdCol (r g b) (vl-load-com) (vla-put-TextWinBackgrndColor (vla-get-Display (vla-get-Preferences (vlax-get-acad-object))) (+ r (* 256 g) (* 65536 b)))) (command "_time" "off" "") (princ) (CmdCol 255 127 127) (defun c:Timer () (vl-load-com) (cond ((not *TimeFlag*) (vl-cmdf "_.time" "_ON" "") (CmdCol 0 255 0) (setq *TimeFlag* T)) (t (vl-cmdf "_.time" "_OFF" "") (CmdCol 255 0 0) (setq *TimeFlag* nil))) (princ)) Quote
Lee Mac Posted June 4, 2009 Posted June 4, 2009 (edited) Try this: ;; Command Line Colour Change by Lee Mac (defun CmdCol (r g b) (vl-load-com) (vla-put-TextWinBackgrndColor (vla-get-Display (vla-get-Preferences (vlax-get-acad-object))) (+ r (* 256 g) (* 65536 b)))) (CmdCol 255 127 127) (defun c:Timer (/ ocm) (setq ocm (getvar "CMDECHO")) (setvar "CMDECHO" 0) (vl-load-com) (cond ((not *TimeFlag*) (vl-cmdf "_.time" "_R" "_ON" "") (CmdCol 191 255 127) (setvar "MODEMACRO" ".") (setq *TimeFlag* T)) (t (vl-cmdf "_.time" "_OFF" "") (setvar "MODEMACRO" (strcat "Elapsed Time: " (menucmd "M=$(edtime,$(getvar,tdusrtimer),HH:MM:SS)"))) (CmdCol 255 127 127) (setq *TimeFlag* nil))) (setvar "CMDECHO" ocm) (princ)) Edited July 3, 2019 by Lee Mac Quote
MikeP Posted June 4, 2009 Author Posted June 4, 2009 Try this dude: Works perfect. thanks man. the only change I made, is that I removed the time reset every time you turn the timer back on. Quote
Lee Mac Posted June 4, 2009 Posted June 4, 2009 Works perfect. thanks man. the only change I made, is that I removed the time reset every time you turn the timer back on. Well, I put that in as I wasn't sure whether the timer is automatically started when a drawing is opened - I'll leave you to experiment. Glad its what you wanted Mike Quote
MikeP Posted June 4, 2009 Author Posted June 4, 2009 Well, I put that in as I wasn't sure whether the timer is automatically started when a drawing is opened - I'll leave you to experiment. Glad its what you wanted Mike Much appreciated Lee. your yet to let me down:D Quote
Bhull1985 Posted January 29, 2014 Posted January 29, 2014 Hey All, Lee... Not to be a thread necro but this has came up, or at least a similar aspect of this topic... The code above changes the command line background color. How could it be adapted to change the TEXT color but leave the background color as what it currently is. Furthermore, I just want to be able to change the text color for one (princ), as in, I want to include it into lisp, to "highlight" certain commands. Why hasn't this been brought up before, perhaps I need to look into it, but figure this is a good start as any. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.