Automatic tagging on pipes

Hello guys, I’m trying to create a script for placing automatic tags in pipes. Can anyone take this doubt from me? Or can someone help me formulate the script? Thank you very much in advance. I will leave the script I’m doing for you to downloadrotina-tags automaticas em tubulações.dyn (11.7 KB)