Skip to main content
Astrosias
November 18, 2024
Solved

How to add nodes to existing group?

  • November 18, 2024
  • 2 replies
  • 192 views

Hi,

I’m writing a plugin that creates a group of nodes. But due to the number of nodes to create (around 100 000) and in order to avoid OutOfMemory errors, I need to do it in batch of 1000.

I currently create a group this way:

  var myGroupNode = figma.group(myInstanceNodes, figma.currentPage)
  myGroupNode.name = "Plugin created group "
  myGroupNode.locked = true

But I can’t find a way to add new nodes inside the group after it’s creation, so I end up with 100 groups of 1000 nodes instead of a single group of 100 000 nodes.

How can I achive this ?

This topic has been closed for replies.
Best answer by tank666
figma.com

2 replies

tank666
tank666Answer
November 18, 2024
UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
Astrosias
AstrosiasAuthor
December 20, 2024

Thanks for the anwser, and sorry for replying a month later.

For anyone stumbling on this while trying to do the same thing (adding 10s of thousands of nodes), remember that a default chromium will die at some point if your project reaches the hundreds of MB.
In the end, I had to create a separate png out of these nodes, and import it afterward.