LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Merge clusters with overrides

Solved!
Go to solution

@BertMcMahan wrote:

@Andrey_Dmitriev wrote:
One approach is to use the “Cluster to Array of VData” and “Array of VData to VCluster” pair functions from the OpenG Toolkit. These let you convert a cluster into an array of variants, override the desired values, and then convert it back. This works under the simple assumption that your values are sequential, so the "Default" cluster always contains the “Strict” portion at the beginning:

 

 


You can combine the OpenG tools with the Data Parsing Tools to get the variant's element name. This appears to work:

 

BertMcMahan_0-1763591388976.pngBertMcMahan_1-1763591398602.png

 

 

I'd recommend switching this to a VIM, then it should work without any coercion dots or variant shenanigans. Please note I didn't test this fully, so there could be some corner cases that don't work (like nested clusters, clusters that contain actual variants, etc.). It also uses cluster element names to match up the data, so if your cluster elements are unnamed, it won't work.

 


If you don't want to install OpenG you can modify it like this:

Yamaeda_0-1764262961466.png

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 21 of 22
(16 Views)

@Yamaeda wrote:

@BertMcMahan wrote:

@Andrey_Dmitriev wrote:
One approach is to use the “Cluster to Array of VData” and “Array of VData to VCluster” pair functions from the OpenG Toolkit. These let you convert a cluster into an array of variants, override the desired values, and then convert it back. This works under the simple assumption that your values are sequential, so the "Default" cluster always contains the “Strict” portion at the beginning:

 

 


You can combine the OpenG tools with the Data Parsing Tools to get the variant's element name. This appears to work:

 

BertMcMahan_0-1763591388976.pngBertMcMahan_1-1763591398602.png

 

 

I'd recommend switching this to a VIM, then it should work without any coercion dots or variant shenanigans. Please note I didn't test this fully, so there could be some corner cases that don't work (like nested clusters, clusters that contain actual variants, etc.). It also uses cluster element names to match up the data, so if your cluster elements are unnamed, it won't work.

 


If you don't want to install OpenG you can modify it like this:

Yamaeda_0-1764262961466.png

 


Here it is as a malleable.

0 Kudos
Message 22 of 22
(5 Views)