+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16
  1. #1
    Forum Newbie
    Using
    AutoCAD LT 2013
    Join Date
    Jan 2016
    Posts
    8

    Unhappy RGB to ACI colour, can I automatically convert RGB objects to autocad colours?

    Registered forum members do not see this ad.

    Hello there,


    I have a file (probably exported from rhino, not sure about that though) where all objects have rgb colour properties to them. White lines are RGB 255, 255, 255, which makes them look fine in model space, though they look white on white in paper space. I would like to convert those objects to WHITE, so that I can set a print profile that would make them print black if that makes sense? At the moment I can only select the objects one by one, which is nearly impossible as the drawing is quite big. I tried to use quickselct, which kind of worked, though it did not allow me to select objects belonging to blocks (of which there are plenty, unfortunately!).


    Thanks a lot for any help!


    G

  2. #2
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,725

    Default

    Ignoring the other part for the moment this is a possible way of getting at the colour values, you could do a selection and pick what you want as a using "X" could produce some odd results. As in the example you would need some form of list like 255,255,255 is color index now 7 White/black and Colormethod = 195

    Code:
    maybe this will work
    ; get the colour values
    (setq obj (vlax-ename->vla-object (car (entsel)))) ; pick an object
    (setq col (vla-get-TrueColor obj))
    (vlax-Dump-Object col)
    
    this is a RGB
     IAcadAcCmColor: AutoCAD AcCmColor Interface
    ; Property values:
    ;   Blue (RO) = 38
    ;   BookName (RO) = ""
    ;   ColorIndex = 52
    ;   ColorMethod = 194
    ;   ColorName (RO) = ""
    ;   EntityColor = -1025917402
    ;   Green (RO) = 190
    ;   Red (RO) = 217
    
    this is colour 152
    ; IAcadAcCmColor: AutoCAD AcCmColor Interface
    ; Property values:
    ;   Blue (RO) = 204
    ;   BookName (RO) = ""
    ;   ColorIndex = 152
    ;   ColorMethod = 195
    ;   ColorName (RO) = ""
    ;   EntityColor = -1023410024
    ;   Green (RO) = 102
    ;   Red (RO) = 0
    
    (vla-put-ColorMethod col 195)
    (vla-put-ColorIndex col x) ;x is 1-255
    A man who never made mistakes never made anything

  3. #3
    Forum Newbie
    Using
    AutoCAD LT 2013
    Join Date
    Jan 2016
    Posts
    8

    Default

    Hello Bigal, thanks for your reply!


    unfortunately I could not understand much of it! :-)


    I might not be an advanced enough cad user (I have not used any code before). I did however try to paste the code you posted into the command line, but that led to no results. Sorry I think it's me making some mistake here!


    Could you please be more precise as to how to use the code? Should I paste everything into the command line? should I omit some lines? Should I aste the code in different batches? etc...


    Many thanks!

  4. #4
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,725

    Default

    I need to do some more homework as well.
    A man who never made mistakes never made anything

  5. #5
    Super Moderator Cad64's Avatar
    Computer Details
    Cad64's Computer Details
    Operating System:
    Windows 7 Profesional x64
    Computer:
    XI Computers
    Motherboard:
    Asus P8Z77-V Pro
    CPU:
    Intel Core I7 3770K 4.1 Ghz Quad Core 3rd Gen
    RAM:
    24GB DDR3 @ 1333MHz
    Graphics:
    Nvidia GeForce GTX 570 1280MB GDDR5
    Primary Storage:
    SATAII 500GB 7200 RPM
    Secondary Storage:
    Western Digital My Book Studio Edition II - 2TB capacity
    Monitor:
    HPf2105 21" LCD Widescreen & Cintiq 21ux
    Discipline
    Multi-disciplinary
    Cad64's Discipline Details
    Occupation
    Freelance Digital Artist
    Discipline
    Multi-disciplinary
    Details
    3D model building, texturing and rendering. Photoshop Color Graphics.
    Using
    AutoCAD 2014
    Join Date
    Feb 2006
    Location
    Southern California
    Posts
    10,139

    Default

    Can't you just open your layer manager and change the layers that are 255,255,255 to white? Or is there a color override on the objects so that color is not set bylayer?
    CGSociety Portfolio: http://rdeweese.cgsociety.org/
    Facebook:
    https://www.facebook.com/rdeweese67/


    "Work Smart, Not Hard"

  6. #6
    Forum Newbie
    Using
    AutoCAD LT 2013
    Join Date
    Jan 2016
    Posts
    8

    Default

    Hi Cad64,


    thank you for your comment!


    and yes, unfortunately I cannot change objects colour through changing layers properties as objects are indeed individually overwritten. I could select them one by one but it would take ages (and I would also have to explode or enter all blocks!).


    I have done more researching into the origin of the file, which I now know, was definitely made with rhino. There, all objects were just rgb white, regardless of their layer.


    Any idea, now...?

  7. #7
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    11,725

    Default

    QSelect by color should select all 255,255,255 objects, then change to white or ByLayer.

    For blocks see if this thread for setting All Objects in Blocks to Layer 0 helps.
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  8. #8
    Forum Newbie
    Using
    AutoCAD LT 2013
    Join Date
    Jan 2016
    Posts
    8

    Default

    Hi SLW210!


    yeah qselect works, had successfully tried that. Unfortunately I could not work with the thread you recommended as I have never worked with codes and I do not seem to be able to make sense of that :-(


    Sadly, I do not know what a lisp is.


    If you could guide me through how to make us of that thread I will be grateful. Am I supposed to copy the des in the boxes in the command line at all? Should the all thing be pasted in there at once? I have tried that but autocad does not seem to respond by moving all objects in blocks to layer 0, which is what those commands are supposed to do, right?


    thanks a lot!

  9. #9
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    11,725

    Default

    How to use LISP.

    If it is LISP in a Code Tags (like the ones on the link I posted), just copy all of the contents in the code box to Notepad and save as a .lsp , if you see a defun c:norm2 in the code, then the norm2 is the command to call the LISP.
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  10. #10
    Forum Newbie
    Using
    AutoCAD LT 2013
    Join Date
    Jan 2016
    Posts
    8

    Default

    Registered forum members do not see this ad.

    ok I will try that, thanks a lot.


    just a quick question: the first code does not read defun c:norm2. Instead, it says: defun c:fixblocks


    how do I call the LISP in this case?


    many thanks

Similar Threads

  1. How to convert layer colour properties on multiple drawings quickly?
    By misskiti in forum AutoCAD Drawing Management & Output
    Replies: 8
    Last Post: 20th Aug 2013, 10:44 am
  2. Convert from index colours to true colours
    By djguinan in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 6th Jan 2012, 05:50 pm
  3. HELP Looping 'Convert Bylaer colour and linetype'
    By Micko79 in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 7th Nov 2011, 05:01 pm
  4. Convert all layer colours to white - and back again
    By geo in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 28th Nov 2008, 01:59 am
  5. How do you automatically set layers you want objects on?
    By echochamber in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 6th Oct 2006, 06:10 am

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts