News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Shape Data not shown in XML

Started by Memnok, December 06, 2018, 05:16:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Memnok

Hello,

I have a electrical schematic in visio that i'm trying to parse for data to display in another program. I unzip the visio file and parse the XML pages for data fields. My problem is that in a certain case the data field will not be stored in the shape XML data, but it's still visible in Visio so the information must be somewhere but i can't find it. The other problem is that this only happends when the data field value is "1", any other value seems to work fine.


This is a typical connector in the schematic, it consists of 3 Pins that are grouped together, it has a Data field called REF that is called out to the label above it.


Each Pin has a data field with its number


Here is the XML data of this connector, you can see the group shape with ID 2010 and each grouped shape
ID 1994 Pin 1
ID 2002 Pin 2
ID 2006 Pin 3
Pin 2 and 3 both have a <Property> field with the "Pin" data field and the Value for that field. But Pin 1 does not have this data.

Now, if i decide to name Pin 1 something else, like say "1 " (it works with everything except "1")

So now the value has a blankspace after the number


When i look up the data field now Pin 1 has a <Property> field and you can see the "Pin" Value which is "1 "

Does anyone here know why the value disappears or where the information is saved?
Thankful for any help with this.

Paul Herber

Shape.1994 is a grouped shape. Could the data be in one of the sub-shapes?
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Memnok

No, that's just the blue background, the text callout from the "Pin" data field and one more shape that i don't really know what it is, seems related to the text callout, but none of them has a <Property> field.
As you can see i changed the data field back to "1" and the <Property> field dissapeared.

Croc

Maybe master 126 has a value of 1 and is it inherited?

Memnok

Quote from: Croc on December 06, 2018, 05:47:49 PM
Maybe master 126 has a value of 1 and is it inherited?

Does not seem like it, i can't find a <Property> field in the master document either.
I also noticed that when the value is filled in correctly there's a lot more information in the shape. I changed it back to "1 "

Croc

#5
I insist.
Here is an example for .vdx

<Master ID='0'
...
<Shapes><Shape ID='5'
...
<Prop NameU='p' ID='1'><Value Unit='STR'>2</Value>
...
<Shape ID='1'
...
</XForm></Shape>
...
<Shape ID='2'
...
</XForm><Prop NameU='p' ID='1'><Value Unit='STR'>1</Value>


I assigned the value 2 to the master. Now on the page is missing 2, but there is 1.
(I used the old XML format, but it doesn't matter)

Croc

In addition, if you look at ShapeSheet, then in one of the shapes, the Value cell will be marked with color as inherited, and with the rest, the color of the new value will be used.

Memnok

Quote from: Croc on December 06, 2018, 06:21:34 PM
In addition, if you look at ShapeSheet, then in one of the shapes, the Value cell will be marked with color as inherited, and with the rest, the color of the new value will be used.

I can't really find it in the master at all. The information about the text callout is there but nothing about the data field "Pin" which is what my program is looking for.
You can look through the master yourself if you want, https://puu.sh/CduQO/489e7c024b.xml

Croc

In my file, I see it like this:
visio / masters / master1.xml

<?xml version='1.0' encoding='utf-8' ?>
<MasterContents xmlns='http://schemas.microsoft.com/office/visio/2012/main' xmlns:r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' xml:space='preserve'>
<Shapes>
<Shape ID='5' Type='Shape' LineStyle='3' FillStyle='3' TextStyle='3'>
<Cell N='PinX' V='0.1968503937007877'/>
<Cell N='PinY' V='0.1968503937007853'/>
<Cell N='Width' V='0.3937007874015754'/>
<Cell N='Height' V='0.3937007874015706'/>
<Cell N='LocPinX' V='0.1968503937007877' F='Width*0.5'/>
<Cell N='LocPinY' V='0.1968503937007853' F='Height*0.5'/>
<Cell N='Angle' V='0'/>
<Cell N='FlipX' V='0'/>
<Cell N='FlipY' V='0'/>
<Cell N='ResizeMode' V='0'/>
<Section N='Property'>
<Row N='p'>
<Cell N='Value' V='1' U='STR'/>

Put your file (vsdx) here. Remove from there all but one shape (group).

Memnok

Here's the first shape in the master.

<?xml version='1.0' encoding='utf-8' ?>
<MasterContents xmlns='http://schemas.microsoft.com/office/visio/2012/main' xmlns:r='http://schemas.openxmlformats.org/officeDocument/2006/relationships' xml:space='preserve'>
<Shapes>
<Shape ID='5' Type='Group' LineStyle='0' FillStyle='0' TextStyle='0' UniqueID='{F811FFC2-FDBC-4EFF-97CF-13F5FFBC677C}'>
<Cell N='PinX' V='0'/><Cell N='PinY' V='0'/><Cell N='Width' V='1.333333333333333'/>
<Cell N='Height' V='1'/>
<Cell N='LocPinX' V='0' F='Width*0'/>
<Cell N='LocPinY' V='0' F='Height*0'/>
<Cell N='Angle' V='0'/>
<Cell N='FlipX' V='0'/>
<Cell N='FlipY' V='0'/>
<Cell N='ResizeMode' V='0'/>
<Cell N='DisplayMode' V='1'/>
<Cell N='FillForegnd' V='#f0f0f0'/>
<Cell N='LineColor' V='14'/>
<Section N='User'>
<Row N='visDGDefaultPos'>
<Cell N='Value' V='PNT(2,3)' U='PNT' F='PNT(2,3)'/>
<Cell N='Prompt' V='' F='No Formula'/>
</Row>
</Section>
<Section N='Geometry' IX='0'>
<Cell N='NoFill' V='0'/>
<Cell N='NoLine' V='0'/>
<Cell N='NoShow' V='0'/>
<Cell N='NoSnap' V='0'/>
<Cell N='NoQuickDrag' V='0'/>
<Row T='RelMoveTo' IX='1'>
<Cell N='X' V='0'/><Cell N='Y' V='0'/>
</Row>
<Row T='RelLineTo' IX='2'>
<Cell N='X' V='1'/>
<Cell N='Y' V='0'/>
</Row>
<Row T='RelLineTo' IX='3'>
<Cell N='X' V='1'/>
<Cell N='Y' V='1'/>
</Row>
<Row T='RelLineTo' IX='4'>
<Cell N='X' V='0'/>
<Cell N='Y' V='1'/>
</Row>
<Row T='RelLineTo' IX='5'>
<Cell N='X' V='0'/>
<Cell N='Y' V='0'/>
</Row>
</Section>


After this part there's the next shape ID 6 and then 7, 6 is the text callout.

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 326 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1197KB.
Tokens: post-login.
Cache hits: 15: 0.00238s for 26,723 bytes (show)
Cache misses: 5: (show)
Queries used: 17.

[Show Queries]