Jump to content

Recommended Posts

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • MikeP

    15

  • Lee Mac

    11

  • David Bethel

    1

  • Bhull1985

    1

Top Posters In This Topic

Posted
Whats your CMDECHO set to?

 

0, when I set it to 1, it opens up the cmd window everytime i hit f12

Posted

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))

Posted (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 by Lee Mac
Posted
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.

Posted
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. :D

 

Glad its what you wanted Mike :)

Posted
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. :D

 

Glad its what you wanted Mike :)

 

 

Much appreciated Lee. your yet to let me down:D

  • 4 years later...
Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...