Change Selected Line Stlye

I have a graph that allows me to select model elements and changes Line Style to a predetermined style; if Line Style ‘A’, change to Line Style ‘1’ then filter out ‘A’ move on to next check. if Line Style ‘B’, change to Line Style ‘1’ etc.
Hoping to simplify the graph to the least number checks.

What I would like to do is have it check for ‘A’, and/or ‘B’ and change to Line Style ‘1’. I have tried several combinations of lacing to no avail.

Hi @MBCT ,

If you want to change the line style from A to 1, B to 2, etc. you could create a simple Code Block:

Current == “A” ? 1 :
Current == “B” ? 2 :
Current == “C” ? 3 :
Current ;

This way no filtering or anything is needed, since the output of this Code Block can be directly used as the input for your Element.SetParameterValueByName node.

You could also create a dictionary where you then get the value corresponding to the current linestyle, which is the key.

Change the lacing and the List@Level

Thank you both for the quick responses. I will need to investigate further yours @Daan . I feel it will definitely help in the long run.

@Daniel_Hurtubise Could you explain why the change List@Level?

It allows you to check each item from list one with each item contain in list 2.
If you are not aware of List@Level i suggest you google it, there is several good source of information and it’s a basic concept to master when using lists.
Have fun :slight_smile: