Add a prefix or suffix to a existing element name

Moderators: cyao, michael_borland

Post Reply
yuehao
Posts: 40
Joined: 25 Oct 2011, 14:50

Add a prefix or suffix to a existing element name

Post by yuehao » 17 Feb 2012, 10:31

Hi, All

Can I use alter_elements command to add a prefix or suffix to a existing element's name, and then save the new lattice to a file?

Thanks,
Yue

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Add a prefix or suffix to a existing element name

Post by michael_borland » 17 Feb 2012, 10:34

Yue,

No, alter_elements is just for changing the parameters of an element.

You might be able to do what you want with replace_elements and/or insert_elements.

--Michael

yuehao
Posts: 40
Joined: 25 Oct 2011, 14:50

Re: Add a prefix or suffix to a existing element name

Post by yuehao » 17 Feb 2012, 11:01

Thank you, Michael

From the manual, my understanding is replace_element requires a pre-defined element. My task is that I have a piece of lattice that will reuse in a machine design many times. I try to assign them different prefix to the name for different locations. Is there smart ways to implement than manually typing in?

Thanks again,
Yue

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Add a prefix or suffix to a existing element name

Post by michael_borland » 17 Feb 2012, 11:27

Yue,

What I would normally do in a case like this is to write a Tcl script to create the lattice. The script can have whatever loops it needs to write the repeating section out with the desired names.

--Michael

yuehao
Posts: 40
Joined: 25 Oct 2011, 14:50

Re: Add a prefix or suffix to a existing element name

Post by yuehao » 17 Feb 2012, 11:35

Thank you, I will write a script to do it.

Post Reply