# "Pack" and Send a Large Set of Data Without Losing the Data Tree

**URL:** <https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402>\
**Category:** Grasshopper\
**Tags:** windows, data-tree\
**Created:** [October 8, 2026, 4:18pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402 "2026-10-08T16:18:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloudsvisitor77](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cloudsvisitor77/32/771524_2.png) [@cloudsvisitor77](https://discourse.mcneel.com/u/cloudsvisitor77)\
**Post date:** [October 8, 2026, 4:18pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/1 "2026-10-08T16:18:27Z")

</div>

HI

I am working on a large definition.

For better organization of the logic i have divided the projects in subgroups in different parts of the canvas.

MY GOAL : i need to transfers large set of datas from 1 place to the other and access those data where i need to use them , **i need the data structure to be exactly the same downstream** …to do this i’d need a “PACK component” with zoomable interface to set NR of inputs…i then would need an “UNPACK” COMPONENT that can match nr of outputs automatically ( same as explode tree ) and that return same identical data structure and path number for the data

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/f/c/9fcbd0cf8ab6197be8f6ea4a9a10f8a09f39458f.png)

I have been using “entwine component” successfully until now and it worked because all list in the branches were always simple flattened lists ( no tree )…but in this case i need to transfer a list of booleans with a specifci tree and i am not able ,i tried to use “wrap List” / "unwrapp list " ( by Metahopper) but i lose the data structure , see TEST2 attached file.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/f/c/dfcfe65a4712f638c80aca9576379082198129f4.png)

is there such a component that allow me to simply pack any sort as shown above unpack them wherever i need ? it would be very useful to organize the data and the job in massive definitions.

thanks.

[20261008 TRANSFERING DATA.gh](https://discourse.mcneel.com/uploads/short-url/gpCVWgMjEE5Hm4JkqUxT2ScpPud.gh) (26.6 KB)

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [October 8, 2026, 5:28pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/2 "2026-10-08T17:28:08Z")

</div>

> [@cloudsvisitor77](#):
>
> I have been using “entwine component” successfully until now and it worked because all list in the branches were always simple flattened lists ( no tree )…but in this case i need to transfer a list of booleans with a specifci tree and i am not able

Right click Entwine to access the “Flatten/Graft” options of the component. (I am talking about the hanging tab, not the inputs)

---

<div class="post-metadata">

**Author:** ![cloudsvisitor77](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cloudsvisitor77/32/771524_2.png) [@cloudsvisitor77](https://discourse.mcneel.com/u/cloudsvisitor77)\
**Post date:** [October 8, 2026, 6:24pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/3 "2026-10-08T18:24:53Z")

</div>

Hi @Volker_Rakow , i tried either flatten or graft and both are not doing what i Need , they both change the data tree , with flatten i lose the tree , with graft i add a branch and when i esplode It back and.match i have a ton of branches ..

I am notnin the office now , Need to try later.

That said i thino that a “pack” “unpack” component that can compress any sort of data and its tree inside different index would be very useful..i havent seen anything like that until now

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [October 8, 2026, 7:11pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/4 "2026-10-08T19:11:20Z")

</div>

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/0/4/60409346f739f0f148a86917f3e5b5e586329ef8.png)  
[20261008 TRANSFERING DATA VR1.gh](https://discourse.mcneel.com/uploads/short-url/gjHCnJkB2KEKr6eeF6sPJkJ4AgF.gh) (58.4 KB)

Note that this will never be dynamic because Explode Tree is not dynamic.

---

<div class="post-metadata">

**Author:** ![cloudsvisitor77](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cloudsvisitor77/32/771524_2.png) [@cloudsvisitor77](https://discourse.mcneel.com/u/cloudsvisitor77)\
**Post date:** [October 8, 2026, 7:15pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/5 "2026-10-08T19:15:46Z")

</div>

@maje90 , i tried you C# component taken from this [thread](https://discourse.mcneel.com/t/useful-objects-groups/222508) but it does not fix my problem , it actually produce same result as the Metahopper components

your script :

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/4/6/946fd837506f1f37bc1489bef99575920f0fe0c3.png)

here is MetaHopper wrap/unwrap

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/1/8/8180be7f8b465b7e6294764caef701367e802c91.png)

what i need is nothing but a many input component that do nothing but storing and packing data in a single object , it should work with any sort of data type and allow user to send data it remotely without changing anything , the only changeable thing is the nr.of inputs and the corresponding nr of output in to the unpack ( opposite ) component

---

<div class="post-metadata">

**Author:** ![cloudsvisitor77](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cloudsvisitor77/32/771524_2.png) [@cloudsvisitor77](https://discourse.mcneel.com/u/cloudsvisitor77)\
**Post date:** [October 8, 2026, 7:21pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/6 "2026-10-08T19:21:29Z")

</div>

Hi @Volker_Rakow , and thanks! Yes, this is exactly what I need to do. Thanks a lot!

I just wonder what is holding the GH developers back from creating a native GH component that works similarly to Entwine, but simply allows grouping N wires into one, and another component that decompresses one wire back into many without changing anything.

This would be very useful for organizing definitions and keeping the canvas cleaner.

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/772775_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [October 8, 2026, 7:30pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/7 "2026-10-08T19:30:32Z")

</div>

You can flatten a datastream and then later unflatten with original stream as guide data tree

---

<div class="post-metadata">

**Author:** ![cloudsvisitor77](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cloudsvisitor77/32/771524_2.png) [@cloudsvisitor77](https://discourse.mcneel.com/u/cloudsvisitor77)\
**Post date:** [October 8, 2026, 8:24pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/9 "2026-10-08T20:24:19Z")

</div>

YES AND NO , I mean , under a logical point of view you are right , i was able to restore the tree structure but it does not solve my need.

I want a single wire but when i entwine everything in a single wire i can either flatten or graft but it messed up the tree again and if i want it to work i need N+1 wires as first image = hard to handle when entwine has several inputs

like this it works :

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/f/4/1f43b5c162ba9056472e5ef185a17fbf424649f9.png)

i need a single wire like this below in order to keep canvas clean and to ease connections and mainteinance and modifications

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/5/e/05ed0873cfe7542e132a28993441cdb31cb65e83.png)

conclusion : the entwine should have 3 option instead of 2 ..it should have

- "flatten "
- “graft”
- “nothing”

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [October 8, 2026, 8:39pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/10 "2026-10-08T20:39:34Z")

</div>

You cannot use Unflatten Tree to split a data tree.

@cloudsvisitor77 Please mark a solution.

---

<div class="post-metadata">

**Author:** ![cloudsvisitor77](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cloudsvisitor77/32/771524_2.png) [@cloudsvisitor77](https://discourse.mcneel.com/u/cloudsvisitor77)\
**Post date:** [October 8, 2026, 8:53pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/11 "2026-10-08T20:53:13Z")

</div>

thanks for your solution @Volker_Rakow , i remember facing this problem other times in the past and yes , thats helpful

that said , am i wrong when say this ?

> [@cloudsvisitor77](#):
>
> conclusion : the entwine should have 3 option instead of 2 ..it should have
> 
> - "flatten "
> - “graft”
> - “nothing”

i think that having an entwine that return unchanged data thus allowing to transfer lot data in a single wire could be very useful , this would actually be the result :

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/3/3/b33b87a8cb4538bd966256029f475822605b524a.png)

- 1 main data flow “grouped” data
- 2,3,4 unpacked
- 5 packed data to be added to the main data flow

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [October 8, 2026, 9:08pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/12 "2026-10-08T21:08:10Z")

</div>

> [@cloudsvisitor77](#):
>
> i need a single wire like this below in order to keep canvas clean and to ease connections and mainteinance and modifications

I wouldn’t worry about it. For me, canvas cleanliness is not a good enough reason to want to combine and unentangle data like this.

> [@cloudsvisitor77](#):
>
> that said , am i wrong when say this ?
> 
> > [@cloudsvisitor77](#):
> >
> > conclusion : the entwine should have 3 option instead of 2 ..it should have
> > 
> > - "flatten "
> > - “graft”
> > - “nothing”

Yes. A stream can only ever carry a single data tree. Either you flatten data while entwining, so that branches from different sources with matching branch addresses merge, or graft so that each data set is a subset of the whole.

What you are looking for, I suppose, is some sort of data tree splitting component that has expandable outputs and splits at branch depth. Someone could make this component… the question is if it would be useful. Expandable output components are generally sketchy. They do not expand or contract automatically. The user needs to “Match outputs” from the context menu. And even if the number of outputs would update automatically, how would you decide wiring? Say on one solve, the component reduces to one output. Then the next expands to five. Or a hundred. What then? But it’s not a bad idea.

---

<div class="post-metadata">

**Author:** ![Measure](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/measure/32/651816_2.png) [@Measure](https://discourse.mcneel.com/u/Measure)\
**Post date:** [October 8, 2026, 9:20pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/13 "2026-10-08T21:20:33Z")

</div>

Here is a python script (~90% vibe coded) that reverses the `Entwine + graft` operation. It splits the incoming data by first branch index, makes sure the component has the right number of output nodes, and routes the branches to the correct output while stripping the extra path index added by the graft operation of Entwine.

[20261008 TRANSFERING DATA python.gh](https://discourse.mcneel.com/uploads/short-url/wcGYbWIAkLBd5XmKGrhEiUp9r6H.gh) (36.1 KB)

```auto
import Grasshopper as gh
from Grasshopper.Kernel.Data import GH_Path, GH_Structure
from Grasshopper.Kernel.Types import GH_ObjectWrapper
import RhinoCodePluginGH

def reverse_entwine():
	# 1. Group the paths by their first index
	grouped_branches = {}
	
	for i in range(D.BranchCount):
		path = D.Path(i)
		branch_data = D.Branch(i)
		
		if path.Length > 0:
			first_idx = path[0] # This represents which Entwine input it came from
			
			# Create a shortened path by removing the first index
			new_path_indices = [path[j] for j in range(1, path.Length)]
			if not new_path_indices:
				new_path_indices = [0]
			new_path = GH_Path(*new_path_indices)
			
			# Use GH_Structure[GH_ObjectWrapper] to satisfy IGH_Structure
			if first_idx not in grouped_branches:
				grouped_branches[first_idx] = GH_Structure[GH_ObjectWrapper]()
			
			# Wrap raw python/rhino objects into Grasshopper Goo wrappers
			wrapped_data = [GH_ObjectWrapper(item) for item in branch_data]
			grouped_branches[first_idx].AppendRange(wrapped_data, new_path)

	# 2. Determine how many outputs we need based on the highest Entwine index found
	target_count = max(grouped_branches.keys()) + 1 if grouped_branches else 1
	current_count = ghenv.Component.Params.Output.Count
	
	# 3. Schedule a topology change if the output count doesn't match
	if current_count != target_count:
		def callback(doc):
			params = ghenv.Component.Params
			
			# Add missing outputs
			while params.Output.Count < target_count:
				new_idx = params.Output.Count
				nickname = "R"
				p = RhinoCodePluginGH.Parameters.ScriptVariableParam(nickname)
				p.Name = "Entwine Out {}".format(new_idx)
				p.Access = gh.Kernel.GH_ParamAccess.tree
				params.RegisterOutputParam(p)
				
			# Remove excess outputs
			while params.Output.Count > target_count:
				last_idx = params.Output.Count - 1
				params.UnregisterOutputParam(params.Output[last_idx])
				
			params.OnParametersChanged()
			ghenv.Component.ExpireSolution(True)

		ghenv.Component.OnPingDocument().ScheduleSolution(5, gh.Kernel.GH_Document.GH_ScheduleDelegate(callback))

	# 4. Safely push the modified GH_Structures to their respective outputs
	for i in range(ghenv.Component.Params.Output.Count):
		output_param = ghenv.Component.Params.Output[i]
		output_param.ClearData() # Prevent data accumulation on refreshes
		
		if i in grouped_branches:
			output_param.AddVolatileDataTree(grouped_branches[i])

# Run the execution routine
reverse_entwine()

```

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [October 8, 2026, 9:21pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/14 "2026-10-08T21:21:19Z")

</div>

> [@Volker\_Rakow](#):
>
> What you are looking for, I suppose, is some sort of data tree splitting component that has expandable outputs and splits at branch depth.

Ask you may receive!

---

<div class="post-metadata">

**Author:** ![Measure](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/measure/32/651816_2.png) [@Measure](https://discourse.mcneel.com/u/Measure)\
**Post date:** [October 8, 2026, 9:24pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/15 "2026-10-08T21:24:10Z")

</div>

> [@Volker\_Rakow](#):
>
> Expandable output components are generally sketchy.

This script uses a callback function to modify its own outputs without the right click menu step. It seems to work fine on this small file, but I’m not sure it wouldn’t do an entire re-run of a large solution and waste a bunch of time or something.

---

<div class="post-metadata">

**Author:** ![cloudsvisitor77](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cloudsvisitor77/32/771524_2.png) [@cloudsvisitor77](https://discourse.mcneel.com/u/cloudsvisitor77)\
**Post date:** [October 8, 2026, 9:29pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/16 "2026-10-08T21:29:01Z")

</div>

AWSOME JOB @Measure I am going to use and test it. i really appreciate

---

<div class="post-metadata">

**Author:** ![cloudsvisitor77](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cloudsvisitor77/32/771524_2.png) [@cloudsvisitor77](https://discourse.mcneel.com/u/cloudsvisitor77)\
**Post date:** [October 8, 2026, 9:35pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/17 "2026-10-08T21:35:39Z")

</div>

> [@Volker\_Rakow](#):
>
> What you are looking for, I suppose, is some sort of data tree splitting component that has expandable outputs and splits at branch depth. Someone could make this component… the question is if it would be useful. Expandable output components are generally sketchy. They do not expand or contract automatically. The user needs to “Match outputs” from the context menu. And even if the number of outputs would update automatically, how would you decide wiring? Say on one solve, the component reduces to one output. Then the next expands to five. Or a hundred. What then? But it’s not a bad idea.

in simple word what i need is nothing but an entwine component that does not flatten or graft…it only wrap and stream in a single object complex sets of data and stream this data somewhere , i dont need input and output to change or update automatically cause it is just a placeholder and wrapper that make this set of data available everywhere down the definition., wherever i need

i have been using this approach on arranging massive definitions for a while now and i can assure that this practice helps a lot on keeping massive scripts scalable, ordered , easy to update, read and modify

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [October 8, 2026, 9:40pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/18 "2026-10-08T21:40:19Z")

</div>

Yes. And what I am trying to explain is that such a thing is not possible with in the bounds Grasshopper’s concept of data structure. There is no “entwining” that does not flatten or graft…

It doesn’t matter. I understand what you mean essentially.

For completion’s sake, some native Grasshopper variants:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/3/8/c386c0b3529bd79797fbd2d72829723884bc09b8.png)

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [October 8, 2026, 9:58pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/19 "2026-10-08T21:58:06Z")

</div>

Much more useful to me would be a Tree Branch component that:

- takes masks instead of paths
- provides separate outputs for each branch of provided masks
- ~~has a renumber bool input~~

🥹 🙏 If you are ever up to it.

---

<div class="post-metadata">

**Author:** ![Measure](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/measure/32/651816_2.png) [@Measure](https://discourse.mcneel.com/u/Measure)\
**Post date:** [October 8, 2026, 11:26pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/20 "2026-10-08T23:26:56Z")

</div>

The Divide Branches component is pretty close to this.

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/770451_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [October 8, 2026, 11:38pm UTC](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402/21 "2026-10-08T23:38:36Z")

</div>

From the Tree Sloth plug-in? Kind of.

[Next page](https://discourse.mcneel.com/t/pack-and-send-a-large-set-of-data-without-losing-the-data-tree/223402.md?page=2)
