ModelSpace Layers ONLY

Discussion in 'AutoCAD' started by Matt W, Apr 27, 2004.

  1. Matt W

    Matt W Guest

    Is there a way to get a list of all layers that are used in ModelSpace???
    If so, how?!?

    Thanks in advance!

    --
    Matt W

    There are 3 kinds of people:
    Those who can count, and those who can't.
     
    Matt W, Apr 27, 2004
    #1
  2. Matt W

    Jeff Mishler Guest

    Something like this....

    For Each obj in Modelspace
    strLay = obj.Layer
    'place the strLay in a container (array, collection, dictionary...your
    choice)
    If typeof obj is blockreference then
    'get the block definition
    'step through the block def and get those layers
    End if
    Next

    Note this isn't real code, just a start of an idea for you.....

    HTH,
    Jeff
     
    Jeff Mishler, Apr 27, 2004
    #2
  3. Matt W

    vinceglorto Guest

    You should use "select" methode with filter on layer.
    set first Modelspace as activespace and create a selectionset
    dxf code for layer is 8
    You can code like this

    Dim gpCode(0) As Integer
    Dim dataValue(0) As Variant
    gpCode(0) = 8
    dataValue(0) = "LAYER_NAME"

    Dim groupCode As Variant, dataCode As Variant
    groupCode = gpCode

    dataCode = dataValue

    ssetObj.Select mode, corner1, corner2, groupCode, dataCode

    Use Autocad help for more details
     
    vinceglorto, Apr 28, 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.