Layer Properties HELP

Discussion in 'AutoCAD' started by keithwaite, May 5, 2004.

  1. keithwaite

    keithwaite Guest

    I have Standard Layer names in my drawing like the following:
    B-Door-00, B-Wall-00, B-Windows-00, etc..
    They all contain the following settings: Color=Blue, Linetype=Continous, Lineweight=Default, Plot=Plot

    I want to be able to run a VBA code to compare the layers and make sure that they have the correct settings, in case the user changed them. Only thing is that some of the drawings contain all these layers and some do not according to what is in the drawing.

    Can wild cars be used? Such as B-*-00, where the * could be Door, Wall or Window?

    If so how would the code be wrote?

    I have something like this already.
    ' ' code begins
    Dim entry As AcadLayer
    Dim objNewLayer As AcadLayer

    For Each entry In ThisDrawing.Layers

    If entry.Name = "B-Door-0" Then
    Set objNewLayer = ThisDrawing.Layers.Add("B-Door-0")
    objNewLayer.color = 6
    objNewLayer.Lineweight = acLnWtByLwDefault
    objNewLayer.Plottable = True
    objNewLayer.Linetype = "Continuous"
    Next
    '' end code

    Thanks for your help,
    Keith
     
    keithwaite, May 5, 2004
    #1
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.