Did you check the Ruby console when you ran that code? It should contain error messages about the problem (which, as Jim says, is very likely that no such file exists at the given path).
Also remember that if you do fix your code… and you do get a reference to a line of text from that oddly located file, then it might contain the name of the component, but with a newline character at the end… e.g. "compo_name\n"
So you should do a .chomp! to remove that…
Otherwise it’ll not be the exact same name you’re expecting…
AND of course all of this presupposes that this named component is already loaded into the model.definitions ??
thank tig
rather the component already exists in the file,
when creating the first time.
Then I want him to repeat the same component with the same name several times reading the name in txt file that contains the name .