Visual Basic Customization

Reply
Active Contributor
lanieuwe
Posts: 40
Registered: ‎10-26-2011
Message 1 of 3 (198 Views)
Accepted Solution

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

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

 

 

 

*Expert Elite*
Alfred.NESWADBA
Posts: 8,893
Registered: ‎06-29-2007
Message 2 of 3 (190 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
-------------------------------------------------------------------------
Active Contributor
lanieuwe
Posts: 40
Registered: ‎10-26-2011
Message 3 of 3 (183 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ó

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community