This document shows an example about the access to the data stored in the customlib tree. We are using the cmas2d_customlib tree as example.

The customlib tree is stored in a xml document. To manage an xml object, we use the tdom functions, available in https://docs.activestate.com/activetcl/8.6/tcl/tdom

To get the value of the weight applied to the group Point Weight Auto1, we need to define the xpath to the value, and ask it to the document.

set document [$::gid_groups_conds::doc documentElement]

set xpath {/cmas2d_customlib_data/condition[@n='Point_Weight']/group[@name='Point Weight Auto1']/value[@n='Weight']}

set xml_node [$document selectNodes $xpath]

set value [get_domnode_attribute $xml_node v]

To get all the groups assigned to that condition:

set document [$::gid_groups_conds::doc documentElement]

set xpath {/cmas2d_customlib_data/condition[@n='Point_Weight']/group}

foreach group_node [$document selectNodes $xpath] {

set group_id [get_domnode_attribute $group_node name]

}

Note:To see the whole xml document, execute W [[$::gid_groups_conds::doc documentElement] asXML]