Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get layers collection into Combo/Listbox in VBA..

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
Hi,

I'm trying to get the layers collection and put each layer from the collection in the list of a combobox (or listbox). This is what I've got so far:

Code:
Dim layersx As AcadLayers
Dim layerx As AcadLayer
Set layersx = ThisDrawing.Layers
For Each layerx In layersx
    ComboBox2.AddItem (layerx)
Next

..But no joy. Can anyone spot what I missed or suggest the best solution. The VBA/Autocad help menus don't help at all..

Can someone please help me out,

Cheers,

Renegade..
 
Dim layersx As AcadLayers
Dim layerx As AcadLayer
Set layersx = ThisDrawing.Layers
For Each layerx In layersx
ComboBox2.AddItem (layerx.name)
Next

You were right there
 
Cheers Borgunit,

Yeah, the funny thing is, I actually worked it out myself a short while after posting the original thread, but I couldn't get on line to let everyone know not to bother answering it.

Thanks anyway mate,

Renegade..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top