leader color to ByLayer update

Discussion in 'AutoCAD' started by John Coon, Feb 6, 2004.

  1. John Coon

    John Coon Guest

    Can someone explain how to update the color of a leader that was set by a
    color. I'm trying to set the new color to bylayer
    which is the color of c-text, yellow

    Thanks for all your help.
    John coon


    Public Sub setdimlayer()
    Dim objlayer As AcadLayer
    Set objlayer = ThisDrawing.Layers.Add("C-text")
    objlayer.Color = acYellow
    Dim Ent As AcadEntity
    Dim Leader As AcadLeader
    Dim Dimension As AcadDimension
    For Each objEntity In ThisDrawing.ModelSpace

    If TypeOf objEntity Is AcadDimension Then
    Set objDimension = objEntity
    objDimension.Layer = "c-text"
    objDimension.Color = acByLayer
    ElseIf TypeOf objEntity Is AcLeaderType Then
    Set objLeader = objEntity
    objLeader.Layer = "c-text"
    objLeader.Color = acByLayer
    objLeader.DimensionLineColor = acByLayer
    objLeader.Update
    ElseIf TypeOf objEntity Is AcadMText Then
    Set objMText = objEntity
    objMText.Layer = "c-text"
    objMText.Color = acByLayer
    End If

    Next

    End Sub
     
    John Coon, Feb 6, 2004
    #1
  2. John Coon

    krispy Guest

    It worked when I changed this line:
    ElseIf TypeOf objEntity Is AcLeaderType Then
    To this:
    ElseIf TypeOf objEntity Is AcadLeader Then
     
    krispy, Feb 6, 2004
    #2
  3. John Coon

    john coon Guest

    Krispy,

    It changes the mtext and if I inserted another leader it would take the
    bylayer color. But these existing dimleaders
    were set to color red. I think I have to get to the named dimstyle to change
    it.

    John
     
    john coon, Feb 6, 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.