Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: DavidJT on December 17, 2014, 07:37:16 PM

Title: Storing Shape Reference in ShapeSheet
Post by: DavidJT on December 17, 2014, 07:37:16 PM
I have an application where I clone shapes in a manner that changes to the original shape propagate to the clones, i.e. changing the fill color or line weight on the original also changes the same properties on the clones.  The formulas in the clones are written through a VBA routine but I am looking for something that can be done more in the shapesheet.

What I am fundamentally looking for is storing a reference to the original in each clone, maybe a User.Original field.  I know that storing a shape in a user field isn't realistic but I can store the shapes id.  What I can't seem to do is to utilize the id elsewhere in the shapesheet to serve as a reference to the original.  Am I overlooking a shapesheet function that does this?

As an example, the FillForegnd cell's formula might look like =ShapeFromID(User.Original)!FillForegnd where User.Original = "Sheet.5" or 5.

Another application that I have for this functionality is that I would like for the shapesheet Comment cell (under Miscellaneous) to contain a value stored in the shape data of a related shape.  I use little "tags" (basic circle object) in the rows of a custom table where the tag can be cloned and placed into a drawing and serves as a reference back to a table of data.  I would like the mouseover functionality of the tag to show the primary value in the table.  The text in tags is simply a one-up number corresponding to the row in the table.

Is there a shapesheet function that can convert a string that contains a shape id into a reference to the shape?
Title: Re: Storing Shape Reference in ShapeSheet
Post by: DavidJT on December 17, 2014, 07:50:42 PM
The SHEETREF function has similar functionality to what I am seeking.  If I created two user fields:

User.1 = SHEETREF(User.2)
User.2 = "PinX"

The value of User.1 evaluates to the contents of the PinX field.  SHEETREF, in my opinion, would have been more aptly named CELLREF.

The equivalent functionality that I am seeking might look like:

User.Original = "Sheet.35" or "35"
FillForegnd = SHAPEREF(User.Original)!FillForegnd
Title: Re: Storing Shape Reference in ShapeSheet
Post by: Surrogate on December 17, 2014, 10:00:07 PM
try use SETF function.
(http://visio.getbb.ru/gallery/image.php?pic_id=140)
1. you change value in cell Prop.N
2. Formula contained in cell User.Row_4 create formula (i.e. reference) for cell User.Target
3. You get new value in cell User.Target
Title: Re: Storing Shape Reference in ShapeSheet
Post by: DavidJT on December 17, 2014, 10:32:52 PM
Surrogate, this does work but it unfortunately forces a user.field to be created to house a SETF formula for ever reference that you need to make to target shape.  If I want to link entire sections of the shapesheet, that is potentially a large number of user fields.  I was hoping for a shapesheet function that was the equivalent to the VBA function .ItemFromID.  Thank you for the input though.
Title: Re: Storing Shape Reference in ShapeSheet
Post by: Surrogate on December 17, 2014, 11:10:09 PM
you can change some shapesheet cells in one formula like this
SETF(GetRef(LinePattern),"sheet"&Prop.n&"!LinePattern")+SETF(GetRef(LineWeight),"sheet"&Prop.n&"!LineWeight")+SETF(GetRef(FillForegnd),"sheet"&Prop.n&"!FillForegnd")
(http://visio.getbb.ru/gallery/image.php?pic_id=141)
for long formulaes use formula editor
(http://visio.getbb.ru/gallery/image.php?pic_id=142)
Title: Re: Storing Shape Reference in ShapeSheet
Post by: mb-ing on October 29, 2018, 10:19:25 AM
Hello together,

are there already news on this subject?

I have a very similar case and I have already researched this topic intensively.
I want to get data from another shape. Both shapes are associated with a Connection Point. The "Callout" should Show data of the other shape :)

I am very grateful for any help from you.

Thank you in advance for your efforts.

With reagrds
MB-Ing.
Title: Re: Storing Shape Reference in ShapeSheet
Post by: Surrogate on October 29, 2018, 10:45:33 AM
IMHO: You need use VBA, not only ShapeSheet formulas
We need more details about your issue.
Title: Re: Storing Shape Reference in ShapeSheet
Post by: mb-ing on October 29, 2018, 02:18:57 PM
@Surrogate:

Thank you very much for your Reply.

The formula CALLOUTTARGETREF()!... helps me to solve my issue :)

My Case:
I have a shape (Shape 1) which includes a text. This text is edited by shape data.
Now I want to insert a shape (Shape 2), which is compareable to a callout.
I move the connection Point to Shape1, so Shape 2 is associated with Shape 1.
After that Shape 2 Shows the text of Shape 1.

But if I move the Connection Point of Shape 2 to another Shape, the text is changed to the new associated shape....
I can make sure, that all shapes have the same property.

For Example:
=CALLOUTTARGETREF()!Prop.Name

With reagrds
MB-Ing.