Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: Another_Noone on February 27, 2017, 11:29:28 AM

Title: Access Shape Data across master shapes
Post by: Another_Noone on February 27, 2017, 11:29:28 AM
Hi,
my problem is:

I have 2 MasterShapes.
I need to Access the Shape Data of one MasterShape from a Shape within the other MasterShape.
I tried using
Masters[Legende]!Sheet.55!Prop.size (Legende is the masterShape wich contains the data i need, its on Sheet 55 and called size)
It seems to work (Auto completion shows the prop.size, but as soon as i enter,
it says i have a formula error in this block.
So,
1. where is my mistake
2. Or is there an easier way to get the shape data for my formula
?
Thx in advance
Title: Re: Access Shape Data across master shapes
Post by: Surrogate on February 27, 2017, 11:42:56 AM
IMHO: References like Masters[Legende] impossible in Visio
Title: Re: Access Shape Data across master shapes
Post by: Another_Noone on February 27, 2017, 11:44:41 AM
Quote from: Surrogate on February 27, 2017, 11:42:56 AM
IMHO: References like Masters[Legende] impossible in Visio
Are you sure?
If yes, is there another way to access the data?
Title: Re: Access Shape Data across master shapes
Post by: Surrogate on February 27, 2017, 11:47:32 AM
Quote from: Another_Noone on February 27, 2017, 11:44:41 AMAre you sure?
Yes!
Quote from: Another_Noone on February 27, 2017, 11:44:41 AMis there another way to access the data?
Which data you need ? And what kind of access ?
Title: Re: Access Shape Data across master shapes
Post by: Another_Noone on February 27, 2017, 11:49:57 AM
Quote from: Surrogate on February 27, 2017, 11:47:32 AM
Which data you need ? And what kind of access ?
The Mastershape has a ShapeData called size (a number), wich i need to include in a formula within a shapedata for another shape (in another mastershape!)
Title: Re: Access Shape Data across master shapes
Post by: Surrogate on February 27, 2017, 11:54:34 AM
IMHO The best wai is use TheDoc cells for that task
Title: Re: Access Shape Data across master shapes
Post by: Another_Noone on February 27, 2017, 11:58:39 AM
Quote from: Surrogate on February 27, 2017, 11:54:34 AM
use TheDoc cells
How exactly would I do that, Im not that experienced.
Title: Re: Access Shape Data across master shapes
Post by: Surrogate on February 27, 2017, 12:05:50 PM
1. add user-defined cell in TheDoc, for example user.size
2.in another master add user-defined cell with formula
SETF(GetRef(TheDoc!User.size),sheet.55!Prop.size)
3. in target shape you can use reference: TheDoc!user.size
Title: Re: Access Shape Data across master shapes
Post by: Another_Noone on February 27, 2017, 12:12:58 PM
Quote from: Surrogate on February 27, 2017, 12:05:50 PM

SETF(GetRef(TheDoc!User.size),sheet.55!Prop.size)


Answer from Visio is:
Mistake in formula
Title: Re: Access Shape Data across master shapes
Post by: Surrogate on February 27, 2017, 01:40:52 PM
can you attach there vsd-file with simple example
Title: Re: Access Shape Data across master shapes
Post by: Another_Noone on February 27, 2017, 02:23:17 PM
I just figured it out, thank you.
My mistake was, i put the user.size cell into the Pages ShapeSheet, and not the documents.
Now it works, like its supposed to.
Title: Re: Access Shape Data across master shapes
Post by: Surrogate on February 27, 2017, 03:07:14 PM
I was wrong !
Quote from: Surrogate on February 27, 2017, 11:42:56 AMIMHO: References like Masters[Legende] impossible in Visio
Quote from: M$FT Dev Center article About Cell References (https://msdn.microsoft.com/en-us/library/office/ff768760.aspx)
To reference a cell ofUse this syntaxExample
The same shapeCellNameWidth
A shape, group, or guideShapename!CellNameStar!Angle
A shape, group, or guide in which more than one shape at the same   
level has the same name
Shapename.ID!CellNameExecutive.2!Height
A named column with indexed rowsSection.Column[index]Char.Font[3]
An unnamed column with indexed rowsSection.ColumnIndexScratch.A5
Any shape, page, master, or styleSheet.ID!CellNameSheet.8!FillForegnd
A masterMasters[MasterName]!SheetName!CellReference          Masters[Gear]!Shaft!Geometry1.X1
The page or master page on which the object is locatedThePage!CellReferenceThePage!User.Vanishing_Point
Another page in the documentPages[PageName]!SheetName!CellReferencePages[Page-3]!Sheet.4!BeginX
A styleStyles!SheetName!CellReferenceStyles!Manager!LineColor
The DocumentTheDoc!CellReferenceTheDoc!PreviewQuality
A shape, page, master, document, or style with a nonstandard name.     'Sheetname'!CellName'1-D'!LineColor