• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Visual Basic Customization

    Reply
    Active Contributor
    lanieuwe
    Posts: 40
    Registered: ‎10-26-2011
    Accepted Solution

    How to make the selected value in a combobox the current layer in the drawing

    119 Views, 2 Replies
    12-19-2012 07:09 AM

    Private Sub UserForm_Initialize() Dim layerColl As AcadLayers Dim entry As AcadLayer Dim LayList As String Set layerColl = ThisDrawing.Layers For Each entry In layerColl ComboBox1.AddItem entry.Name Next End Sub

     

    Hi,

    I have a form with a combobox. That combobox is filled up with all layers in a drawing. (see above)

    Now I want to make the layer that I have selected (value) in the combobox the current layer in my drawing.

     

    How can i make it current?

     

    thanks gr. László

     

     

     

    Please use plain text.
    *Expert Elite*
    Posts: 6,639
    Registered: ‎06-29-2007

    Re: How to make the selected value in a combobox the current layer in the drawin

    12-19-2012 09:26 AM in reply to: lanieuwe

    Hi,

     

    try

    ThisDrawing.ActiveLayer = ThisDrawing.Layers.Item(Combobox1.Text)

     

    -. alfred -

    -------------------------------------------------------------------------
    Alfred NESWADBA
    Ingenieur Studio HOLLAUS ... www.hollaus.at
    -------------------------------------------------------------------------
    Please use plain text.
    Active Contributor
    lanieuwe
    Posts: 40
    Registered: ‎10-26-2011

    Re: How to make the selected value in a combobox the current layer in the drawin

    12-20-2012 01:53 AM in reply to: alfred.neswadba

    Thank you Alfred! 

    It was the item...

     

    I wish you a nice christmas!

    László

    Please use plain text.