dave-howard / vsdx

vsdx - A python library for processing .vsdx files
BSD 3-Clause "New" or "Revised" License
70 stars 25 forks source link

How to change value of shape data? #57

Closed JS-Aibel closed 1 year ago

JS-Aibel commented 1 year ago

Hi, How do we change the value of a shape data and save it to a new file? The following code does not save the new value of the shape data to the new file.

with VisioFile('diagram.vsdx') as vis:
    page = vis.pages[0]
    code_a_shape = page.find_shape_by_property_label_value('test', 'testvalue')

    code_a_shape.data_properties['test'].value = '00'                

    vis.save_vsdx('shape_changed.vsdx')
dave-howard commented 1 year ago

Hi @JS-Aibel - this isn't supported right now - but I will add in next release (should be a trivial change)

dave-howard commented 1 year ago

HI @JS-Aibel - this has been added in v0.5.14 - you can now set value prop of DataProperty and it will be persisted when file is saved