Page tree
Skip to end of metadata
Go to start of metadata

getZone(nameOrPosition)

Description

Function to retrieve the Zone object of a zone in the specified layer. For example, this.parent defines the parent layer of the script module as the layer to be searched in. This function does not search in sublayers. A particular zone can be searched by name or position. The position is the number indexing the zones in the specified layer. If several zones share the same name, only the first match will be returned. If no argument is set, the function returns the first zone it finds.

Available in: Controller, Processor.

Arguments

nameOrPositionThe name or position of the zone. Set this to nil to deactivate the name filter.string or number, optional

Return Values

Returns the Zone object of the found zone. Returns nil if no zone is found.

Example

-- get the first zone in the program and print its name
zone = this.program:getZone()

if zone then
    print(zone.name)
else
    print("Could not find a zone!")
end

3 Comments

    1. Please reread. Thanks!

Write a comment…