VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
lanieuwe
664 Views, 2 Replies

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


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ó

 

 

 

2 REPLIES 2
Message 2 of 3
Alfred.NESWADBA
in reply to: lanieuwe

Hi,

 

try

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

 

-. alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Tags (1)
Message 3 of 3
lanieuwe
in reply to: Alfred.NESWADBA

Thank you Alfred! 

It was the item...

 

I wish you a nice christmas!

László

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost