Visual Basic Customization

Visual Basic Customization

Reply
Valued Contributor
lanieuwe
Posts: 57
Registered: ‎10-26-2011
Message 1 of 3 (213 Views)
Accepted Solution

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

213 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ó

 

 

 

Thank you Alfred! 

It was the item...

 

I wish you a nice christmas!

László

*Expert Elite*
Alfred.NESWADBA
Posts: 9,562
Registered: ‎06-29-2007
Message 2 of 3 (205 Views)

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
-------------------------------------------------------------------------
Valued Contributor
lanieuwe
Posts: 57
Registered: ‎10-26-2011
Message 3 of 3 (198 Views)

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ó

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.