Author Topic: True Colour help  (Read 2239 times)

0 Members and 1 Guest are viewing this topic.

ROBBO

  • Bull Frog
  • Posts: 217
True Colour help
« on: July 15, 2014, 06:28:14 AM »
Code - Auto/Visual Lisp: [Select]
  1. (vla-put-TextColor (vlax-ename->vla-object e) acMagenta)

Although I can achieve the magenta colour for text as shown in the line above, but I would like to achieve the true colour 255,0,255.

I have tried, but failed. Any help or suggestions to achieve this goal would be much appreciated.

Kind regards, Robbo.
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

ChrisCarlson

  • Guest
Re: True Colour help
« Reply #1 on: July 15, 2014, 07:41:08 AM »
Do you want true color or RGB? The property you listed is RGB format

//doh! had mixed up different programs, disregard above

I'd peruse Lee's site

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

tombu

  • Bull Frog
  • Posts: 289
  • ByLayer=>Not0
Re: True Colour help
« Reply #2 on: July 15, 2014, 08:39:35 AM »
Google acad_truecolordlg, for an object to be true color the DXF code 420 needs to be set.  I've attached a lisp for modifying attributes including color as an example. 
Tom Beauford P.S.M.
Leon County FL Public Works - Windows 7 64 bit AutoCAD Civil 3D

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: True Colour help
« Reply #3 on: July 15, 2014, 09:51:34 AM »

Have a play

Code - Auto/Visual Lisp: [Select]
  1. (defun c:doit (/ add stuff here)
  2.                  (vlax-get-acad-object)
  3.                  (strcat "AutoCAD.AcCmColor." (substr (getvar "acadver") 1 2))
  4.                )
  5.   )
  6.   (vla-setrgb colObj 255 0 255)
  7.   (setq thingy (car (entsel)))
  8.   (vla-put-truecolor (vlax-ename->vla-object thingy) colObj)
  9. )
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

ROBBO

  • Bull Frog
  • Posts: 217
Re: True Colour help
« Reply #4 on: July 15, 2014, 10:33:28 AM »
Thanks all for the info. Will read up and have a play.

Kind regards, Robbo.
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

ROBBO

  • Bull Frog
  • Posts: 217
Re: True Colour help
« Reply #5 on: July 16, 2014, 02:56:29 AM »
Had a go. Although I had some success. Was unable to change a text colour value within a dimension. Nevertheless have learned something and appreciated the help and advice above.

Kind regards, Robbo
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: True Colour help
« Reply #6 on: July 16, 2014, 03:33:40 AM »

Ahhhh ..
http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-36320A64-4513-4249-9FF0-ECF19C0B6EC1
Quote
TextColor Property (ActiveX)
Specifies the color of the text for dimension and tolerance objects.

>>> Colors can be set and read as numeric index values ranging from 0 to 256. Constants have been provided for the standard seven colors, as well as the BYBLOCK and BYLAYER designations. <<<
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.