Closed LionelCrowl closed 9 months ago
I kindly ask for help in finding a workaround for the following error. Thank you.
test8_simple_connector.vsdx
Traceback (most recent call last): c2 = Connect.create(page=new_page, from_shape=new_shape2, to_shape=new_shape3) # ERROR rels = page.rels_xml.getroot() ^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'getroot'
import shutil from vsdx import VisioFile, Connect src_file = 'test8_simple_connector.vsdx' copy_src = shutil.copy(src_file, 'tmp_src.vsdx') with VisioFile(copy_src) as vis: src_page = vis.pages[0] block_shape = src_page.child_shapes[0] new_page = vis.add_page('new page') # 1 # adding new_shape1, new_shape2 and connecting them new_shape1 = block_shape.copy(new_page) new_shape1.text = 'new shape 1' new_shape2 = block_shape.copy(new_page) new_shape2.text = 'new shape 2' c1 = Connect.create(page=new_page, from_shape=new_shape1, to_shape=new_shape2) vis.save_vsdx('after 1.vsdx') # 2 # adding new_shape3 and connecting it to new_shape2 new_shape3 = block_shape.copy(new_page) new_shape3.text = 'new shape 3' c2 = Connect.create(page=new_page, from_shape=new_shape2, to_shape=new_shape3) # ERROR vis.save_vsdx('test.vsdx')
Hi @LionelCrowl - thanks for the info. I have resolved in v0.5.17 and added a new test based on your code included above
I kindly ask for help in finding a workaround for the following error. Thank you.
File to use:
test8_simple_connector.vsdx
Error:
Traceback (most recent call last): c2 = Connect.create(page=new_page, from_shape=new_shape2, to_shape=new_shape3) # ERROR rels = page.rels_xml.getroot() ^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'getroot'
Code to recreate an error: