HI Zeng,
THanks for your reply. I also feel the code editor is quite hard to use.
But the problem with my code is not that I did not define self.nb_layers. I defined that in my code, I just did not copy that in this post.
I achieve what I want to do with Thomas’ s solution.
CHeers