The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.

General DiscussionFrom the old forum

Lookup and Filter Data with native nodes

2 replies Last reply

  1. Hi,

    Sometimes I see some projects using the lookup and filter data nodes on the output of some other native Nodebox nodes such as using the lookup on the output of a point node to get the x of the point. Is there any way for me to know which items can be filtered or parsed in the output of a node?

    Thanks

    Copy link
  2. Guilherme,

    Yes, there is!

    Use the Keys node. Hook the output of any native Nodebox node to the Keys node. It will produce a list of all they keys that you can look up. Some keys will be internal Nodebox things (e.g. class) that you can't use, but the rest will be fine.

    A special key is "bounds". If you look up the bounds of a rect you will get a 4-tuple, something like "Rect(-50.0, -50.0, 100, 100). The first two values are the x and y of the shape's top left corner; the other two values are its width and height. You can retrieve any of these four values in a single bound by using dot notation:

    bounds.x = top left x
    bounds.y - top left y
    bounds.width = width
    bounds.height = height

    The Keys node is one of my secret weapons. I use it all the time to find these hidden gems.

    Enjoy!

    John

    Copy link

Know something that helps?

Sign in with your email address to reply. No password needed.

Sign in to reply