Change Product Parameter

All topics specific to modeling questions in Enterprise Dynamics
Post Reply
Fischl.Riedhammer
Posts: 11
Joined: Monday 17 February, 2014 - 15:34

Change Product Parameter

Post by Fischl.Riedhammer »

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
Attachments
Change Product Parameter.mod
(50.53 KiB) Downloaded 287 times
tobias.reithmann
Posts: 7
Joined: Monday 02 March, 2015 - 16:34

Re: Change Product Parameter

Post by tobias.reithmann »

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

Code: Select all

sub1 := Rank(1, i)
and generally the nth subcontainer with

Code: Select all

subn := Rank(n, i) {substitute n with some value}
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

Code: Select all

prod1 := Rank(1, sub1)
Putting this together you get the same product also with

Code: Select all

prod1 := Rank(1, Rank(1, i))
and generally the mth product in the nth subcontainer with

Code: Select all

prodm := Rank(m, Rank(n, i))
and so on.

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
You can also use this to move an atom to a new position inside its parent atom by setting a new value like

Code: Select all

Rank(sub1) := 3
This changes the order inside the yellow container i into sub2, sub3, sub1, sub4.
Fischl.Riedhammer
Posts: 11
Joined: Monday 17 February, 2014 - 15:34

Re: Change Product Parameter

Post by Fischl.Riedhammer »

Thank you. It works now
Post Reply