question

Vanessa Buen Abad avatar image
0 Likes"
Vanessa Buen Abad asked Sam Stubbs commented

Which comand returns the content of a rack?

Hello

I would like to write a condition in which if the rack has at least one box, do some instructions but I don't know if "content(Rack1)" is the correct comand because the comand content returns the number of child nodes in a parent node.

I want to write this condition:

If(content(Rack1)<0){

Do something}

I will appreciate your help. Thank you so much

Choose One
racks
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

The content of a rack is never going to be less than 0.

You might want to check to see if the content is greater than 0:

if (content(Rack1) > 0) {
    // do something
}
3 Likes 3 ·
Joerg Vogel avatar image Joerg Vogel commented ·

If you look into the manual inside the commands section you will get the command structure. The first parameter of the content command is an object. That means you have to pass a pointer into this parameter. In the source code editor you often find the predefined pointers item or current. You can look into the manual how the logic works or you use the sampler tool to get such pointer. In relative description you find command words like centerobject, inobject or outobject. A direct pointer reference function name is node. You find those commands described in the manual, too.

0 Likes 0 ·

1 Answer

·
Sam Stubbs avatar image
1 Like"
Sam Stubbs answered Sam Stubbs commented

"content(Rack1)" will work. It returns the number of items in the rack in all bays and levels. If you want to look for something more specific to racks (such as rackgetbaycontent() ) then as Jorg said, you can look in the Commands documentation. (Go to Help > Commands. Or you can go to Help > Command Helper to look up specific commands.)

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Vanessa Buen Abad avatar image Vanessa Buen Abad commented ·

I got it, thank you so much for your help!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.