Contact Us

CATEGORIES

Whoops…Nothing found

Try other keywords in your search

How to get and use API Handles

 0 Minutes

 1 Like

 1443 Views

Get the handle of an object

It is possible to copy the handle of an element by right-clicking on them and selecting "Copy Handle to Clipboard".

Delete

This feature is only available in version 1.9.xxx and above

In 1.8 versions of Pixera we will need to manually gain access to handles on instances. Most instances in Pixera can use the “getInst(string path)” method which will return the handle of the instance.

Clips do not have a handle that can be returned from “getInst(string path)”, so in this case we will need to use the "getId()" function to return the ID of the clip, and then create a handle as described below.

 

How to use the handle in Control with Lua Code

Most functions can use the handle as an argument!

We will set the text of this Text Resource as example:

--first we create a handle object and copy the handle
local handle = pixc.createHandle(6241433728519295)
--then we can do api calls directly with the handle
Pixera.Resources.Resource.setText(handle,"Hello World")

Result:

 

How to use the handle in the API with JSON 

Delete

See the Quick Start Guide for the API first!

API Quick Start Guide

 

As an example, we set the same command with the API

{"jsonrpc":"2.0", "id":18, "method":"Pixera.Resources.Resource.setText", "params":{"handle":6241433728519295, "text":"API"}}

Result:

Pixera 1.9.135 | 11. September 2023

Was this article helpful?