Control length of item individually

Hi,

Not sure if I'm asking it in the right group. But I'll give it a go.

I'm more in the Mechanical/Electrical playing field. And I need to accomplish the following task. I have a cabinet which contains DIN-Rails.The DIN-rails contains drilling holes and depending on the length of the DIN-rail more or less drilling holes are appearing.

I'm able with a EKL script to modify the length and accordingly more or less drilling holes appearing.

But when I insert the second DIN-Rail and modify the length the length of the first inserted DIN-rail is also changing.

My question is how can I control that only the selected item is changed in my assembly?

Below my simple EKL script of the part. And a screenshot as example. 

if (`DIN Rail Length` >= 100mm
    and `DIN Rail Length` <= 499mm)
{
    DrillHole\RectPattern.2\NumberInDir1 = 2    
}

if ( `DIN Rail Length` >= 500mm
    and `DIN Rail Length` <=599mm)
{
    DrillHole\RectPattern.2\NumberInDir1 = 5
}