Select muliple or all Layers

Discussion in 'AutoCAD' started by Kevin Terry, Jul 30, 2004.

  1. Kevin Terry

    Kevin Terry Guest

    With VBA, you'll want to think about things differently than if you were
    doing them directly through dialog boxes or the drawing editor. In other
    words, looping through all layers would be the way to do things:

    dim myLayer as AcadLayer

    for each myLayer in ThisDrawing.Layers
    'change properties of myLayer here...
    next

    hth,
    Kevin
     
    Kevin Terry, Jul 30, 2004
    #1
  2. With VBA, how do you get it to select all or multiple layers so that I can
    change the properties of those layers?
     
    Leonard Johnson, Jul 30, 2004
    #2
  3. I sorry but I'm new to VBA what do you mean by looping? I've been using the
    code examples that Autodesk provides and doing a lot of cut, pasting, trial
    and error to figure things out.
     
    Leonard Johnson, Jul 30, 2004
    #3
  4. You don't.

    Instead, you must itertate the contents of the Layers collection and
    change the properties of each layer you want to modify.
     
    Frank Oquendo, Jul 30, 2004
    #4
  5. Kevin Terry

    Kevin Terry Guest

    the code i posted demonstrates the loop. just paste the code into your
    routine and replace my comment with the code you're going to use to change
    the layer properties.

    Kevin
     
    Kevin Terry, Jul 30, 2004
    #5
  6. thanks

     
    Leonard Johnson, Jul 30, 2004
    #6
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.