Layers Help

Discussion in 'AutoCAD' started by Ozzie, Aug 13, 2004.

  1. Ozzie

    Ozzie Guest

    I have a lstbox on a form form that populates (filtered) with layers I do not need-this works fine. I have a select button that I want to select any object in the drawing and it will populate another lstbox with the layer(s) of that object. any suggestions?
     
    Ozzie, Aug 13, 2004
    #1
  2. Ozzie

    Matt W Guest

    Suggestion: Could you make your posts a little *more* cryptic??

    What exactly do you want to do? You've provided some information, but not
    enough.

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | I have a lstbox on a form form that populates (filtered) with layers I do
    not need-this works fine. I have a select button that I want to select any
    object in the drawing and it will populate another lstbox with the layer(s)
    of that object. any suggestions?
     
    Matt W, Aug 13, 2004
    #2
  3. Ozzie

    Guido Rooms Guest

    Dear Matt,

    As far as I can see, Ozzie has two listboxes that contain layer names.
    The one on the left, say, contains layers which Ozzie doesn't care for.
    The one on the right, say, contains the layers in which Ozzie has a keen
    interest.
    There's also a button, which probably has as caption "Select".
    Now, what Ozzie most probably wants is this: when the user goes "click" on
    this button,
    the user should recieve the polite request to select an entity, and when
    this is done successfully, the
    layer of that entity should be added in some miraculous way to the listbox
    on the right (the interesting one).

    Hope this clarifies the issue.
    Now post that code, and be quick about it!

    Greetings.
     
    Guido Rooms, Aug 13, 2004
    #3
  4. Ozzie

    Matt W Guest

    SIR, YES SIR!!

    Public Sub Test()
    Dim Entity As AcadEntity
    Dim Point As Variant
    Dim objBlock As AcadBlockReference
    Dim strBlockName As String
    ' Hide the form
    ' Me.Hide

    On Error Resume Next
    ThisDrawing.Utility.GetEntity Entity, Point, "Select a block: "
    If TypeOf Entity Is AcadBlockReference Then
    Set objBlock = Entity

    MsgBox objBlock.Layer & vbCr & "I'm sure you can figure out how to
    add the layer name to a list box.", vbInformation + vbOKOnly, "Layer
    Picker-Thinga-ma-jigger"
    ' Show the form
    ' Me.Show
    End If
    End Sub

    I still think his email was a little cryptic. (I've got this program that
    does this thing when I click on something. How can I make it do something
    else when I do something different?) <BG>
     
    Matt W, Aug 13, 2004
    #4
  5. Ozzie

    Guido Rooms Guest

    Great! Fantastic!
    Ozzie will be most grateful for the coherent solution you have offered.
    Let's just hope that you've solved the right problem...
    Ever tried to read "Finnegan's Wake"?
     
    Guido Rooms, Aug 13, 2004
    #5
  6. Ozzie

    Joe Sutphin Guest

    Actually, Matt and Guido, I believe he was looking for something more along
    this line.

    Joe
    --

    Dim Entity As AcadEntity
    Dim Point As Variant

    On Error Resume Next

    Me.Hide

    ThisDrawing.Utility.GetEntity Entity, Point, "Select an entity: "

    If Err Then
    Me.Show
    Exit Sub
    End If

    ListBox1.AddItem Entity.Layer

    Me.Show
     
    Joe Sutphin, Aug 13, 2004
    #6
  7. Ozzie

    Matt W Guest

    Who's Wha...??
    I'm still trying to get through "Where's Waldo at the Circus".
    That damn elusive Waldo.

    CURSE YOU WALDO AND YOUR STUPID HAT!!!

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | Great! Fantastic!
    | Ozzie will be most grateful for the coherent solution you have offered.
    | Let's just hope that you've solved the right problem...
    | Ever tried to read "Finnegan's Wake"?
    |
    |
    | | > SIR, YES SIR!!
    | >
    | > I still think his email was a little cryptic. (I've got this program
    that
    | > does this thing when I click on something. How can I make it do
    something
    | > else when I do something different?) <BG>
    | >
    | > --
    | > Matt W
    | >
    | > The difference between genius and stupidity is that genius has its
    limits.
    | >
    | >
    |
    |
     
    Matt W, Aug 13, 2004
    #7
  8. Ozzie

    Guido Rooms Guest

    Your're right Joe.
    The code is short and clear and doing exactly what it should do (if the
    problem is correct)
    But still it was I who distilled a solvable problem out of sheer
    gobble-dee-gook.
    This makes me happy.
    Always nice to cooperate.
    We've done a great job helping Ozzie. All three of us.

    Greetings.
     
    Guido Rooms, Aug 13, 2004
    #8
  9. Ozzie

    Joe Sutphin Guest

    No, since you were able to decipher the meaning in the posters question, you
    take all the credit! I insist. I enjoy writing all kinds of code for others,
    so consider this example a freebie from me to you exclusively!

    Joe
    --
     
    Joe Sutphin, Aug 13, 2004
    #9
  10. Ozzie

    Guido Rooms Guest

    Accepted!
    Thanks a lot, Joe!
     
    Guido Rooms, Aug 13, 2004
    #10
  11. Ozzie

    TomD Guest

    I can't even believe you would say something like that in this NG!?

    Hehehehehe.............now, then, where's my list of coding projects to send
    to Mr. Sutphin......lol
     
    TomD, Aug 14, 2004
    #11
  12. Ozzie

    Joe Sutphin Guest

    Please explain Tom, I'm sure there is something I've already written being
    used by you.

    Incidently, I didn't say I take requests just that I enjoy writing code for
    others.

    Joe
    --
     
    Joe Sutphin, Aug 16, 2004
    #12
  13. Ozzie

    Lunt Guest

    Thank you all...now "can we all just get along" Rodney King :)
     
    Lunt, Aug 16, 2004
    #13
  14. Ozzie

    Lunt Guest

    what I meant was a list box populates with layers (these layers will grouped together as they are part of a block-after purge blocks will be the only things left). I want to be able to pick any layer in that list box and another listbox will show the block it is associated with.
     
    Lunt, Aug 16, 2004
    #14
  15. Ozzie

    TomD Guest

    Just teasing you, Joe.................and yes, I'm sure there is, at least
    partially.
    That's a disclaimer you should have mentioned. ;)
     
    TomD, Aug 16, 2004
    #15
  16. Ozzie

    Joe Sutphin Guest

    Good, there for a minute I thought you were serious!

    Joe
    --
     
    Joe Sutphin, Aug 16, 2004
    #16
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.