color on a layer

Discussion in 'AutoCAD' started by Villars, Aug 26, 2004.

  1. Villars

    Villars Guest

    How do I create a layer and give it color red ?

    thanks
     
    Villars, Aug 26, 2004
    #1
  2. Villars

    Jeff Mishler Guest

    Dim oLay As AcadLayer
    set oLay = ThisDrawing.Layers.Add("MyNewRedLayer")
    oLay.Color = 1
     
    Jeff Mishler, Aug 26, 2004
    #2
  3. Villars

    Villars Guest

    thanks
     
    Villars, Aug 26, 2004
    #3
  4. Villars

    Matt W Guest

    If you're using 2004 or higher, you should use TrueColor instead.
    From the ACAD Help file...
    Remarks

    This property is obsolete and will be removed in a future version.


    Try this:

    Public Sub NewLayer()
    Dim lay As AcadLayer
    Dim color As AcadAcCmColor

    Set color = New AcadAcCmColor
    With color
    .ColorMethod = acColorMethodByACI
    .ColorIndex = "1"
    End With

    Set lay = ThisDrawing.Layers.Add("MyNewRedLayer")
    lay.TrueColor = color
    End Sub



    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | thanks
    | "Jeff Mishler" <> skrev i en meddelelse
    | | > Dim oLay As AcadLayer
    | > set oLay = ThisDrawing.Layers.Add("MyNewRedLayer")
    | > oLay.Color = 1
    | >
    | > --
    | > Jeff
    | > check out www.cadvault.com
    | > > How do I create a layer and give it color red ?
    | > >
    | > > thanks
    | > >
    | > >
    | >
    | >
    |
    |
     
    Matt W, Aug 26, 2004
    #4
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.