pyCGM_Single.pycgmIO.loadVSK

pyCGM_Single.pycgmIO.loadVSK(filename, dict=True)

Open and load a vsk file.

Parameters
filenamestr

Path to the vsk file to be loaded

dictbool, optional

Returns loaded vsk file values as a dictionary if False. Otherwise, return as an array.

Returns
[vsk_keys, vsk_data]array

vsk_keys is a list of labels. vsk_data is a list of values corresponding to the labels in vsk_keys.

Examples

RoboSM.vsk in SampleData is used to test the output.

>>> from .pyCGM_Helpers import getfilenames
>>> filename = getfilenames(x=3)[2]
>>> filename
'SampleData/Sample_2/RoboSM.vsk'
>>> result = loadVSK(filename)
>>> vsk_keys = result[0]
>>> vsk_data = result[1]
>>> vsk_keys
['Bodymass', 'Height', 'InterAsisDistance',...]
>>> vsk_data
[72.0, 1730.0, 281.118011474609,...]

Return as a dictionary.

>>> result = loadVSK(filename, False)
>>> type(result)
<...'dict'>

Testing for some dictionary values.

>>> result['Bodymass']
72.0
>>> result['RightStaticPlantFlex']
0.17637075483799