09-10-2020 12:17 PM
A Cluster when being passed into a mathscript node becomes a Structure.
A Structure when being passed out a mathscript node becomes a Cluster.
Here is the script, that you can refer
Here, I passed a cluster named "Area1".
Then, I can use "Area1.xxxx" to access to values of this Cluster.
I defined a structure named "Load_Cmds", then I can give values for its elements as "Load_Cmds.xxxx".
Then, when I pass out that structure, "Load_Cmds" becomes a Cluster.
Thanks,
Bang Nguyen, Clarkson University
09-10-2020 06:28 PM - edited 09-10-2020 06:31 PM
@BangNg wrote:
Here is the script, that you can refer
No, that's just a picture.
(What you are describing is already covered in the help.)
09-10-2020 06:34 PM
Here is the script:
-----------------------Access to Cluster named "Area1"-------
Pload(1)= Area1.Vtl_CrClg; Pload(2)= Area1.Vtl_CrElt; Pload(3)= Area1.Vtl_MsClg; Pload(4)= Area1.Vtl_MsElt;
Pload(5)= Area1.NVtl_CrClg; Pload(6)= Area1.NVtl_CrElt; Pload(7)= Area1.NVtl_MsClg; Pload(8)= Area1.NVtl_MsElt;
Pload(9)= Area1.MW_load; Pload(10)= Area1.IPNC_load; Pload(11)= Area1.Propulsion; Pload(12)= Area1.HRRL;
--------------------Define a Structure named "Load_Cmds"------
Load_Cmds.VCrClg_cd=O(1);Load_Cmds.VMsClg_cd=O(2);Load_Cmds.VCrElt_cd=O(3);Load_Cmds.VMsElt_cd=O(4);
Load_Cmds.NCrClg_cd=O(5);Load_Cmds.NMsClg_cd=O(6);Load_Cmds.NCrElt_cd=O(7);Load_Cmds.NMsElt_cd=O(8);
Load_Cmds.MW_cmd=O(9);Load_Cmds.IPNC_cmd=O(10);Load_Cmds.Prop_cmd=O(11);Load_Cmds.HRRL_cmd =O(12);
-------------------------------------------------------------------------------
If you have more questions, please let me know,