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

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

Anonymous
Not applicable
1,315 Views
2 Replies
Message 1 of 3

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

Anonymous
Not applicable

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ó

 

 

 

0 Likes
Accepted solutions (1)
1,316 Views
2 Replies
Replies (2)
Message 2 of 3

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

try

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

 

-. alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

Thank you Alfred! 

It was the item...

 

I wish you a nice christmas!

László

0 Likes