how to hide a layer with category name instead of layer no

HI

I have some layers in my nx file

I want to hide a layer

I recorded a journal which gives the below code

Dim stateArray3(0) As NXOpen.Layer.StateInfo
stateArray3(0) = New NXOpen.Layer.StateInfo(64, NXOpen.Layer.State.Hidden)
workPart.Layers.ChangeStates(stateArray3, False)

this code hides the layer number 64,

how can i edit it so that i can use layer category name

https://www.eng-tips.com/viewthread.cfm?qid=462112

There is code posted in the link above that will take the name of a layer category and make all the member layers selectable (visible). Your issue is similar, the code should be a good guide for you.