Open freeholod opened 2 years ago
Below is my simple code that is used to add elements and links to the visio tree:
Hi @freeholod - With regards to connectors: you do not appear to be doing anything incorrect.
The dynamic connector shape is not placed correctly by the package as it is today, until a shape is moved at which point Visio moves the connector ends to the correct location. This is a known issue to be resolved (related to #10 ) this is in progress but the XML processing required is quite complex. The Geometry class and Shape.geometry property were added to support this but more work is needed before that issue is resolved.
With regards to page size - that is a concept I need to add:
Kind regards Dave
Hi @freeholod - With regards to connectors: you do not appear to be doing anything incorrect.
The dynamic connector shape is not placed correctly by the package as it is today, until a shape is moved at which point Visio moves the connector ends to the correct location. This is a known issue to be resolved (related to #10 ) this is in progress but the XML processing required is quite complex. The Geometry class and Shape.geometry property were added to support this but more work is needed before that issue is resolved.
With regards to page size - that is a concept I need to add:
- [ ] to add a property to get/set page size
- [ ] to auto-resize the page (or add a function to auto-resize on demand) based on shape bounds. I expect/hope this will be simpler than the dynamic connector shape! I'll update here if I make progress on either.
Kind regards Dave
Hey Dave! Thanks for the answer. I really hope that you succeed in everything you have planned. Because I analyzed and realized that it was difficult for me to deal with this.
Hi @freeholod - I have just released v0.4.18 which includes Page.height and width properties - hopefully these are helpful / work as expected
Dave
Hi @freeholod - I have just released v0.4.18 which includes Page.height and width properties - hopefully these are helpful / work as expected
Dave
Hey, @dave-howard! Thanks for the new version!
In general, width and height properties work as expected, although I had to correct the coordinates of the shapes, but it's simple. But for some reason, the Autosize button for connectors stopped working. Now connectors are drawn only if you move the shapes in the visio editor.
@dave-howard with 0.4.18 I'm using Connect.create to connect two shapes which I've read in from an existing vsdx (called, imaginatively, "template.vsdx") however the shapes have a None geometry attribute, hence I get a traceback like so:
File "c:/Users/blah/Downloads/REN_nw/rancid_visio.py", line 168, in
Guessing this is something I'm doing but can't get a handle on what!
Hi @freeholod - connector positioning should be improved with v0.4.19. Regards the Autosoze button - I expect there are some other changes that need to be made elsewhere in vsdx file at same time as page size. I'll see if I can re-create that issue.
@dave-howard have tested and I get the same traceback with 0.4.19 - seems like it thinks don't have a geometry object which doesn't seem to cause problems until I go to create a connector using code such as: shape1 = page1.find_shape_by_text('firewall') # type: VisioFile.Shape shape1a = page1.find_shape_by_text('switch') # type: VisioFile.Shape Connect.create(page=page1, from_shape=shape1, to_shape=shape1a)
Thank you @z3ndrag0n for testing - I expect that your firewall and switch shapes are complex / compound shapes - and I haven't tested connecting anything other than simple shapes. Let me add some tests which I expect will fail and re-release once resolved. Cheers Dave
Hello! Are there any updates on this issue?
Hello, I ran into problems with displaying a tree in vsdx.
When opening a file,
firstly: links are displayed incorrectly until you move some figure or select auto-fit on the designer tab.![on_start_view](https://user-images.githubusercontent.com/12254463/151953210-79a4c28e-0ea6-438c-bda3-c3d6722f8fbd.png)
Secondly: the shapes go beyond the dimensions of the template page, this is also corrected when you click the autofit button on the design tab.
After pressing autosize button, i got good result:![after_auto_size](https://user-images.githubusercontent.com/12254463/151953250-8f1fa481-9304-4932-8baa-bd06be047d9b.png)
Please tell me how to fix this? How can I achieve this through python? I tried to do it through pure xml but all attempts failed. Also I can't use vsdm :-(