modified macro for exporting robot in environment