What's the method for locking selected items?

#1

Hi, I’m developing a XD plugin and I just encountered the following issue.

Does anyone know any XD function that allows me to lock elements on the screen?

I went through the whole XD plugin documentation but I couldn’t manage to find any method that gets selected items locked.

At first, I figured something like “commad.lock()”, since there is “command.group()” which is from a nature alike. But it doesn’t exist.

Thanks for your help in advance.

#2

See https://adobexdplatform.com/plugin-docs/reference/scenegraph.html#scenenodelocked--boolean

It’s a read/write property, so you can just set the locked property to true, and it should lock the item.

1 Like
#3

Thanks for the quick reply.

I’ve tried something like

selection.items[0].locked = true;

it worked smoothly.

thanks for helping me.