changing layer color

Discussion in 'AutoCAD' started by Nate Hunter, Jan 22, 2004.

  1. Nate Hunter

    Nate Hunter Guest

    I would like to change the layers color (not objects color). I was thinking
    there would be a oLayer.Color = acRed. But no such luck. Any Ideas?

    I do not want to force the object to a specific color I only want to change
    the layers color to a different color.

    I hope I didn't confuse anyone.

    Thanks in advance for your help
     
    Nate Hunter, Jan 22, 2004
    #1
  2. Nate Hunter

    Warren M Guest

    Hello Nate.

    Yes, there is a color property for a Layer object.
    Unfortunatley, sometimes the Intellisense' features do not show all of the properties or methods... and this is likely what's happening now.

    Try the following:


    Public Sub CreateRedLayer()
    Dim myLayer As AcadLayer
    Set myLayer = ThisDrawing.Layers.Add("My New Layer")
    myLayer.color = acRed
    End Sub

    Hope this helps
    Warren Medernach
     
    Warren M, Jan 22, 2004
    #2
  3. Depending upon the version, assuming is 2004 here, you want to use
    TrueColor. There was a post within the last two weeks that explained how
    to pass a standard acad color to truecolor. It is not a good idea to use
    color - from what I have heard, it's not on the list because it is
    discontinued. The only reason explicitly typing it works is for
    backwards compatability.
    ___________________________
    Mike Tuersley
    CADalyst's AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jan 22, 2004
    #3
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.