Layer State Description

Layer State Description

Anonymous
Not applicable
524 Views
3 Replies
Message 1 of 4

Layer State Description

Anonymous
Not applicable
Hi all,

I have created a form that lists all layer states in a drawing, and when
double clicked, restores that layer state. Given that we do many high rise
buildings, the ability to flick between floor levels in the xref is a great
one.

I can only manage to have our layer state name in the list box, but would
like to have the description in there too.

I have attached the form I am using at the moment in the hope that someone
will be able to assist in this, because I haven't been able to find anything
on the internet or reference books about this.

Thanks in advance

Brent
0 Likes
525 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Switching to a multi column list box might be an option.

Try the sample below.

HTH,

Gary

Private Sub UserForm_Activate()

Dim lbText(0 To 1, 2) As String

LboLayerStates.ColumnCount = 2
'LboLayerStates.ColumnHeads = True

lbText(0, 0) = "Row 1, Col 1"
lbText(1, 0) = "Row 1, Col 2"

lbText(0, 1) = "Row 2, Col 1"
lbText(1, 1) = "Row 2, Col 2"

lbText(0, 2) = "Row 3, Col 1"
lbText(1, 2) = "Row 3, Col 2"

LboLayerStates.Column = lbText

End Sub
0 Likes
Message 3 of 4

Anonymous
Not applicable
Thanks for that Gary - That was better than the idea I had, which was to
combine the Name and description (ie ..... AddItem LayerStateName & " - " &
LayerStateDescritpion

Do you know how to access the layer state descriptions in the
layerstatemanager? I assume that this can be done as AutoCAD shows it.


"Gary McMaster" wrote in message
news:[email protected]...
Switching to a multi column list box might be an option.

Try the sample below.

HTH,

Gary

Private Sub UserForm_Activate()

Dim lbText(0 To 1, 2) As String

LboLayerStates.ColumnCount = 2
'LboLayerStates.ColumnHeads = True

lbText(0, 0) = "Row 1, Col 1"
lbText(1, 0) = "Row 1, Col 2"

lbText(0, 1) = "Row 2, Col 1"
lbText(1, 1) = "Row 2, Col 2"

lbText(0, 2) = "Row 3, Col 1"
lbText(1, 2) = "Row 3, Col 2"

LboLayerStates.Column = lbText

End Sub
0 Likes
Message 4 of 4

Anonymous
Not applicable
I have never worked with layer states. I can't offer any help there.

Concatenating the name and description probably wouldn't be so bad. I guess
the only real advantage to using the list box columns will be the clean text
justification you'll get.

There are problems with "column headers" in list boxes in VBA. Not sure if
it's broken or not meant to work by design but it does not work. The best
solution I've found is to use labels above the list box.

HTH,

Gary
0 Likes