Hello All,
I have a question about changing Parameters of a Product.
A Basic Container (Container 1, Yellow) contains 4 subcontainers (Container 2, Blue).
In this Container 2 are 4 Products.
How can I Change the Parameter of the Product (approx. Icon) without unpacking it for Container 1 (and 2).
I can do it, if I have only one Level (Product on Container) with Rank(e1, i)
But is it possible at Product on Container on Container?
Rank(Rank(e1, i) doesn´t work.
I attached a model to Show what I mean.
But I have to unpack first Level, Change Parameter of Product on Container 2 and pack it again.
Thanks for help
Change Product Parameter
-
- Posts: 11
- Joined: Monday 17 February, 2014 - 15:34
Change Product Parameter
- Attachments
-
- Change Product Parameter.mod
- (50.53 KiB) Downloaded 298 times
-
- Posts: 7
- Joined: Monday 02 March, 2015 - 16:34
Re: Change Product Parameter
Hello,
you missed the right syntax for the command Rank:
Lets have i as your yellow container 1 in some trigger code.
Then you get the first blue subcontainer 2 with
and generally the nth subcontainer with
These are references to atoms again, like i is the reference to the yellow container 1.
So you get the first product inside sub1 with
Putting this together you get the same product also with
and generally the mth product in the nth subcontainer with
and so on.
With only one parameter Rank returns the position of given atom inside its parent atom, i.e.
You can also use this to move an atom to a new position inside its parent atom by setting a new value like
This changes the order inside the yellow container i into sub2, sub3, sub1, sub4.
you missed the right syntax for the command Rank:
Lets have i as your yellow container 1 in some trigger code.
Then you get the first blue subcontainer 2 with
Code: Select all
sub1 := Rank(1, i)
Code: Select all
subn := Rank(n, i) {substitute n with some value}
So you get the first product inside sub1 with
Code: Select all
prod1 := Rank(1, sub1)
Code: Select all
prod1 := Rank(1, Rank(1, i))
Code: Select all
prodm := Rank(m, Rank(n, i))
With only one parameter Rank returns the position of given atom inside its parent atom, i.e.
Code: Select all
Rank(sub1) returns 1
Rank(prodm) returns m
Code: Select all
Rank(sub1) := 3
-
- Posts: 11
- Joined: Monday 17 February, 2014 - 15:34
Re: Change Product Parameter
Thank you. It works now