This DIN rail part is equation driven to change its length and create a pattern of slots along the full length of the rail. It is millimeter based and all values are in millimeters. You can enter a length value in inches as long as you define it with either the double-quote ("), IN or INCH, in either upper or lower case.
The slot spacing is set to 25 mm increments and the pattern is set to create one slot more than the length of the rail for those cases where a slot would be partially cut off when the length is not a multiple of the 25 mm increment.
Download the file and save it to your resources, or standard parts, folder. Open the part and SAVE AS to a new name for the project you are working on. Open the Equation Editor (CTRL+E) and edit the a_aRailLen variable. It should be the first variable in the list. (If the list gets rearranged for some reason, just click the header of the Name column to resort it so the "a" variables are at the top.)
Once you enter the new value for the rail length press TAB or ENTER to update the editor values for length and number of slots in the pattern. Then click the Close button to close the editor and update the rail to the new length and slot values.
There is also a configuration for a "No Slots" version of the rail which simply has the slots suppressed. If you switch configurations and create a new length without slots and then switch back to the configuration with slots, you may see a different length depending on what length you had entered for each configuration.
(This part was created in Alibre Design 2018, version 2018.1.1, Build 19055.)