auto naming function

 From:  noskule
hi all
when building stuff in moi I allways keep the construction elements, like profile and rail when using the sweep command for later modification. Before I do the construction command (like sweep) I name the constrution elements something like "Module:Name.CE" . "CE "means Construction-Element.

What I would like to achieve is that if construction elements have a name the name will be passed on to the newly created object automatically but without the CE ending. Means the objects name would be "Module:Name".

Has anyone an idea how to do this?
Thanks for any hints