Easiest way is to attach all your entities which are named "track_straight" etc... to a hidden, global TRACKpivot :
Then do this ..
global TRACKpivot = createpivot() hideentity TRACKpivot loadmesh( "track_straight", TRACKpivot ) loadmesh( "track_c_right", TRACKpivot )
Then do this ..
t.track=New track ent = findchild( TRACKpivot, temp_text2 ) t\ent=CopyEntity ( ent ) t\mat="metal"