Jump to content

Recommended Posts

Posted

Is there a system variable for this?

Posted

not a variable but under Options > Display tab > Colors > Commandline.

 

Why do you need/want to change the color?

Posted

Lee came up with a dragging text with grread. I was thinking about using it in a routine and matching the text color with the command line text.

Posted

In 2010, its in the "tools" menu, then all the way to the bottom for "options", then the display tab, and hit the "colors" button about midway down in that dialog box. See below.

 

Tiger, I made my command line background black, then changed the text color to yellow. I draw on a black background too. Easier on my eyes than the standard white background.

 

colors.jpg

Posted (edited)

I know where it's located in options. I was just going to entmake text with the color

 

example of what lisp I'm talking about

https://sites.google.com/site/reidbooe/lisp

go to example.avi

Edited by Lt Dan's legs
Posted

Something like this should do it:

 

;; Sets the Command Line Text Color
;; Args: r,g,b  Red,Green,Blue values.

(defun PutCommandLineTextColor ( r g b )
 ;; © Lee Mac 2011

 (vla-put-TextWinTextColor
   (vla-get-Display
     (vla-get-Preferences (vlax-get-acad-object))
   )
   (+ (fix r) (lsh (fix g)  (lsh (fix b) 16))
 )
)

Posted
I know where it's located in options. I was just going to entmake text with the color

 

Apologies' date=' it sounds like you want to retrieve the colour, not change it (as my code demonstrates) - In which case my code is pretty useless.

 

I don't think the OLE_COLOR Variant returned by [i']vla-get-TextWinTextColor[/i] is compatible with the Visual LISP variant functions, so it might be better to get the value straight from the registry and convert it to an RGB colour.

 

(getenv "TextWindow.ForeColor")

 

Note that the 24-bit True Color integer used by AutoCAD is not a true RGB value, but rather 'BGR' as the Red value occupies the third (high) byte. Hence one must convert the OLE_COLOR value to a True Color value before using it with entmake.

 

I'm in the middle of updating my site with such functions so check back soon perhaps.

Posted

not a problem. I didn't really look at the code when I posted that response :oops:. For now I'll stick to what I have

Thanks for all the help guys

Posted

See here for the conversion functions:

 

http://lee-mac.com/colourconversion.html

 

Using the above, you could create your text as follows:

 

(entmakex
 (list
   (cons 0 "TEXT")
   (list 10 0 0 0)
   (cons 40 1.0)
   (cons 1 "Lee Mac")
   (cons 420
     (LM:OLE->True
       (atoi (getenv "TextWindow.ForeColor"))
     )
   )
 )
)

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