truecolor with dcl problem

Discussion in 'AutoCAD' started by liftedaxis, Sep 19, 2004.

  1. liftedaxis

    liftedaxis Guest

    I'm fiddling with truecolor, and have been unable to find on here what exactly the 62 group color number is when an entity has a truecolor. I'm making a dialog box to color things with truecolor, and it seems I need two different version of the color - the RGB value that I convert with Truecolor-split function, but then I need to know the 62 group color to fill the image tiles in the dialog box. Is there a way to derive that color number?

    --Jeremiah
     
    liftedaxis, Sep 19, 2004
    #1
  2. liftedaxis

    BillZ Guest

  3. liftedaxis

    liftedaxis Guest

    that works for the first 256, but what about the other 16 million?
    if i'm going to call the fill_image function to paint a dcl image tile the color of the truecolor, i need to use the ACI value. so how do I derive it?

    --Jeremiah
     
    liftedaxis, Sep 21, 2004
    #3
  4. liftedaxis

    BillZ Guest

    Re: truecolor with dcl problem
    I believe what you want is a OLE Color to ACI.
    There is a lot of info on coverting these on this site.

    I don't have the link to this :

    ;;Bill Zondlo List of OLE color numbers
    ;;Derived from: (+ (car RGB_col)(* 256 (cadr RGB_col))(* 65536 (caddr RGB_col)))
    ;;from a post by jonf (jrf) at the Adesk NG.
    ;;Used dos_acitorgb for RGB #'s.
    ;;
    ;;
    ;;

    (defun OLE_to_ACI (ole_nm /)
    (setq OLELST
    '(0
    255
    65535
    65280
    16776960
    16711680
    16711935
    16777215
    8421504
    12632256
    255
    8355839
    204
    6710988
    153
    5000345
    127
    4145023
    76
    2500172
    16383
    8364031
    13260
    6717388
    9881
    5005209
    8063
    4149119
    4940
    2502476
    32767
    8372223
    26316
    6724044
    19609
    5010073
    16255
    4153215
    9804
    2505036
    49151
    8380415
    39372
    6730444
    29337
    5014937
    24447
    4157311
    14668
    2507340
    65535
    8388607
    52428
    6737100
    39321
    5020057
    32639
    4161407
    19532
    2509900
    65471
    8388575
    52377
    6737074
    39282
    5020037
    32607
    4161391
    19513
    2509890
    65407
    8388543
    52326
    6737049
    39244
    5020018
    32575
    4161375
    19494
    2509881
    65343
    8388511
    52275
    6737023
    39206
    5019999
    32543
    4161359
    19475
    2509871
    65280
    8388479
    52224
    6736998
    39168
    5019980
    32512
    4161343
    19456
    2509862
    4194048
    10485631
    3394560
    8375398
    2529536
    6265164
    2064128
    5209919
    1264640
    3099686
    8388352
    12582783
    6736896
    10079334
    5019904
    7510348
    4161280
    6258495
    2509824
    3755046
    12582656
    14679935
    10079232
    11717734
    7510272
    8755532
    6258432
    7307071
    3755008
    4344870
    16776960
    16777087
    13421568
    13421670
    10066176
    10066252
    8355584
    8355647
    5000192
    5000230
    16760576
    16768895
    13408512
    13415014
    10056192
    10061132
    8347392
    8351551
    4995328
    4997670
    16744192
    16760703
    13395456
    13408614
    10046464
    10056268
    8339200
    8347455
    4990464
    4995366
    16727808
    16752511
    13382400
    13401958
    10036736
    10051404
    8331008
    8343359
    4985600
    4992806
    16711680
    16744319
    13369344
    13395558
    10027008
    10046540
    8323072
    8339263
    4980736
    4990502
    16711743
    16744351
    13369395
    13395583
    10027046
    10046559
    8323103
    8339279
    4980755
    4990511
    16711807
    16744383
    13369446
    13395609
    10027084
    10046578
    8323135
    8339295
    4980774
    4990521
    16711871
    16744415
    13369497
    13395634
    10027122
    10046597
    8323167
    8339311
    4980793
    4990530
    16711935
    16744447
    13369548
    13395660
    10027161
    10046617
    8323199
    8339327
    4980812
    4990540
    12517631
    14647295
    10027212
    11691724
    7471257
    8735897
    6226047
    7290751
    3735628
    4335180
    8323327
    12550143
    6684876
    10053324
    4980889
    7490713
    4128895
    6242175
    2490444
    3745356
    4129023
    10452991
    3342540
    8349388
    2490521
    6245529
    2031743
    5193599
    1245260
    3089996
    3355443
    5987163
    8684676
    11382189
    14079702
    16777215)
    )
    (- (length olelst)(length (member ole_nm olelst)))
    )

    Here is a couple of more links :

    http://discussion.autodesk.com/thread.jspa?messageID=1197624

    http://discussion.autodesk.com/thread.jspa?messageID=1189910

    http://www.jtbworld.com/lisp/DisplayColorProperties.htm

    http://www.ikozmos.com/oasis-xls-help/ColorGroup/ColorTable.htm


    HTH

    Bill
     
    BillZ, Sep 22, 2004
    #4
  5. liftedaxis

    BillZ Guest

    On a side note:

    You will not be able to get 16 million colors in DCL.
    After all there are only 255 ACI numbers.
    DCL is again proved to be insufficient to handle all programming needs.

    You would have to use Object.dcl for that.

    Bill
     
    BillZ, Sep 22, 2004
    #5
  6. liftedaxis

    liftedaxis Guest

    insufficient?
    dude, it's a simple task. a dialog box has a bunch of image buttons, each of various colors. you click the one you want, and the hatch command is fired with the truecolor chosen.
    I've found that when I assign a truecolor to an object, it is assigned a group 62 color. All I want to know is, how is AutoCAD determining that color number? It runs beyond 256 colors, and I haven't seen any mention of how to derive it on here.
    But at the end of the day, the dcl routine is awesome, and vastly simplifies the truecolor process.

    --J
     
    liftedaxis, Sep 23, 2004
    #6
  7. liftedaxis

    BillZ Guest

    I've found that when I assign a truecolor to an object, it is assigned a group 62 color. All I want to know is, how is AutoCAD determining that color number? It runs beyond 256 colors, and I haven't seen any mention of how to derive it on here.<<<

    I maybe have misunderstood what you are saying.
    The reason I said that DCL is insufficient is that, as far as I know, DCL does not support the 16 mil colors that you are desiring. The DCL vector_image function uses an ACI color (0-255) and a few other system/background colors.
    Hence, as I know, there is no OLE or HSL -> ACI color converter. ACI is an index of 256 colors, whick approximates most of the basic colors in AutoCAD.
    If you want to select a color to use in your program from the 16 million available, you will need to use the acad_truecolor function that IS posted in one of the links earlier in this discussion.

    (setq color_pick (acad_truecolordlg '(420 . 16777215)))

    This will return the TrueColor (assoc 420) and the ACI number (assoc 62) of the color picked.

    Remember the assoc 62 (ACI) number is an approximation of the OLE number so you will see the same ACI number returned for many different OLE numbers returned.

    HTH

    Bill
     
    BillZ, Sep 23, 2004
    #7
  8. liftedaxis

    liftedaxis Guest

    WHOA! why the @#$&^#$ isn't that in the documentation? I can call that dialog box?!
    how rich would we all be if we could bill Autodesk for all the time we spun our wheels or dealt with their bugs or insufficient documentation?

    hey, thanks for the info on that. Certainly changes everything I'm working on.

    As for the dialog box, I still want to fill the image_tiles with something, I was just hoping to find a way to derive the group 62 color, given any truecolor.

    --Jeremiah
     
    liftedaxis, Sep 26, 2004
    #8
  9. liftedaxis

    BillZ Guest

    As for the dialog box, I still want to fill the image_tiles with something, I was just hoping to find a way to derive the group 62 color, given any truecolor.<<<

    (car (acad_truecolordlg '(420 . 16711))) will return the 62 number.
    Check out the color-util.lsp found in your C:\Program Files\AutoCAD 2005\Sample\VisualLISP folder. It contains all the conversion subrs for the various color formats.

    Bill
     
    BillZ, Sep 27, 2004
    #9
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.