Results 1 to 5 of 5

Thread: Setting RAL colors

  1. #1
    Patrick EMIN Guest

    Setting RAL colors

    Hi,

    There is an example in AutoCAD help for assigning color book colors to
    objects:

    Sub Example_SetNames()
    'This example draws a circle and
    'returns the color name and color book name of the color.

    Dim col As New AcadAcCmColor
    Call col.SetRGB(125, 175, 235)
    Call col.SetNames("MyColor", "MyColorBook")

    Dim cir As AcadCircle
    Dim pt(0 To 2) As Double
    Set cir = ThisDrawing.ModelSpace.AddCircle(pt, 2)
    cir.TrueColor = col
    ZoomAll

    Dim retCol As AcadAcCmColor
    Set retCol = cir.TrueColor
    MsgBox "BookName=" & col.BookName
    MsgBox "ColorName=" & col.ColorName
    End Sub


    Why is there two lines:

    Call col.SetRGB(125, 175, 235)
    Call col.SetNames("MyColor", "MyColorBook")

    I need to set a RAL color to an object, do I need to use the RGB syntax,
    is the second line of code not enough to give an object a particular color?

    Thanks.

    --
    /////
    (o)-(o)
    -----ooO---(_)---Ooo--------------------------
    Patrick EMIN www.CADxp.com
    Le portail francophone CAO et Nouvelles Technologies

  2. #2
    Ravi Pothineni Guest
    The second line of code is enough
    Sub test()
    Dim col As New AutoCAD.AcadAcCmColor
    col.SetColorBookColor "RAL CLASSIC", "RAL 1002"
    End Sub

    "Patrick EMIN" <pemin@flowline.fr> wrote in message
    news:424d0292$1_3@newsprd01...
    Hi,

    There is an example in AutoCAD help for assigning color book colors to
    objects:

    Sub Example_SetNames()
    'This example draws a circle and
    'returns the color name and color book name of the color.

    Dim col As New AcadAcCmColor
    Call col.SetRGB(125, 175, 235)
    Call col.SetNames("MyColor", "MyColorBook")

    Dim cir As AcadCircle
    Dim pt(0 To 2) As Double
    Set cir = ThisDrawing.ModelSpace.AddCircle(pt, 2)
    cir.TrueColor = col
    ZoomAll

    Dim retCol As AcadAcCmColor
    Set retCol = cir.TrueColor
    MsgBox "BookName=" & col.BookName
    MsgBox "ColorName=" & col.ColorName
    End Sub


    Why is there two lines:

    Call col.SetRGB(125, 175, 235)
    Call col.SetNames("MyColor", "MyColorBook")

    I need to set a RAL color to an object, do I need to use the RGB syntax,
    is the second line of code not enough to give an object a particular
    color?

    Thanks.

    --
    /////
    (o)-(o)
    -----ooO---(_)---Ooo--------------------------
    Patrick EMIN www.CADxp.com
    Le portail francophone CAO et Nouvelles Technologies

  3. #3
    Patrick EMIN Guest
    Ravi Pothineni a écrit :
    The second line of code is enough
    Sub test()
    Dim col As New AutoCAD.AcadAcCmColor
    col.SetColorBookColor "RAL CLASSIC", "RAL 1002"
    End Sub
    Thanks, I'll try that out.
    --
    /////
    (o)-(o)
    -----ooO---(_)---Ooo--------------------------
    Patrick EMIN www.CADxp.com
    Le portail francophone CAO et Nouvelles Technologies

  4. #4
    Patrick EMIN Guest
    Patrick EMIN a écrit :
    Ravi Pothineni a écrit :

    The second line of code is enough
    Sub test()
    Dim col As New AutoCAD.AcadAcCmColor
    col.SetColorBookColor "RAL CLASSIC", "RAL 1002"
    End Sub


    Thanks, I'll try that out.
    It works but it's very, very slow... I guess it's reading the color book
    from the hard disk XML file?
    I resolved to build a table with the RAL colde and the RGB values instead.
    --
    /////
    (o)-(o)
    -----ooO---(_)---Ooo--------------------------
    Patrick EMIN www.CADxp.com
    Le portail francophone CAO et Nouvelles Technologies

  5. #5
    Ravi Pothineni Guest
    It should be slow only the first time the color book is accessed (i.e. the
    XML file is loaded from disk). Any subsequent access to the colorbook in
    that session of AutoCAD should be instantanous.

    "Patrick EMIN" <webmaster@cadxp.com> wrote in message
    news:42558fdb$1_1@newsprd01...
    Patrick EMIN a écrit :
    Ravi Pothineni a écrit :

    The second line of code is enough
    Sub test()
    Dim col As New AutoCAD.AcadAcCmColor
    col.SetColorBookColor "RAL CLASSIC", "RAL 1002"
    End Sub


    Thanks, I'll try that out.
    It works but it's very, very slow... I guess it's reading the color book
    from the hard disk XML file?
    I resolved to build a table with the RAL colde and the RGB values instead.
    --
    /////
    (o)-(o)
    -----ooO---(_)---Ooo--------------------------
    Patrick EMIN www.CADxp.com
    Le portail francophone CAO et Nouvelles Technologies

Similar Threads

  1. Pantone Colors
    By Terry Robb in forum SolidWorks
    Replies: 2
    Last Post: 08-17-2005, 09:10 AM
  2. Getting RAL colors
    By Patrick EMIN in forum VBA
    Replies: 0
    Last Post: 04-01-2005, 02:03 AM
  3. Lisp routine for setting default hatch setting to "associati
    By JamieLandmark in forum Customization
    Replies: 23
    Last Post: 03-31-2005, 07:55 PM
  4. change layer colors
    By dannyhm in forum Customization
    Replies: 2
    Last Post: 03-11-2005, 10:38 AM
  5. SW05 colors
    By Bill Chernoff in forum SolidWorks
    Replies: 10
    Last Post: 01-06-2005, 07:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum