Skip to content

Z.byTag(...)

Studio is being deprecated, please head over to the documentation page for Mattercraft, our most advanced 3D tool for the web, where you can find the most recent information and tutorials.

byTag(t: string): Z.Base[];

Gets an array of nodes with the given tag.

Tags can be set in the Properties panel of a node or using the pushTag(…) function.

ParameterTypeDescription
tstringThe tag to search for.

An array of nodes with the given tag.

// Populate the redArray variable with an array of nodes that have the 'RED' tag assigned to them.
var redArray = Z.byTag("RED");
// Store the number of red objects within a 'count' variable
var count = redArray.length;