dave-howard / vsdx

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

Question about missing attributes #49

Closed arac-codespace closed 1 year ago

arac-codespace commented 2 years ago

Hi,

I'm currently trying to extract some location information for each shape in a visio file. However, I noticed that sometimes these attributes are not mapped to the Shape class and they aren't in the page's xml either.

Is it normal for certain attributes to not appear in the XML at all? For example, I'm trying to detect when a shape is rotated by 90 degrees. The visio file has some default 'System' shapes and I want to get the rotated shape created by that default quick shape in addition to any other that are at an angle. That angle attribute is not shown anywhere though.

XML: image

And this is what I see in the debugger: image

dave-howard commented 2 years ago

Hi @arac-codespace - I have done a simple test by rotating some shapes and checking what that does to shape XML, What I see is an Angle Cell element within the shape xml. I have added a Shape.angle property to make it easy to access this - this will be in v0.5.10 I notice your shape above has a mastershape - I wonder if the master shape is where the angle property is

arac-codespace commented 2 years ago

Thanks @dave-howard

I made a similar test and found the same Angle cell. My initial assumption was that quick shapes have default attributes stored somewhere, and those attributes are not shown in the shape's XML if they are not modified (so the program falls back to using the predefined defaults).

I didn't think of looking for those definitions elsewhere. I'll take a look next week and see if those properties are defined in the master shape or elsewhere. Hopefully they are.