Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: webrosti on November 10, 2021, 04:41:06 PM

Title: Custom List with linked data
Post by: webrosti on November 10, 2021, 04:41:06 PM
Hello Visio Experts  :)

I like to have a list (name "Signal") which will be automatically filled with max. 6 shapes (name "F0", "F1", "F2", "F3" aso...). The definition of which shape shall be used should be done via shape data. The shape data are linked to an external excel sheet.
What i have done:
User defined cells Section:
1. msvStructureType = List
2. msvSDListItemMaster1 = Use(ShapeID)
3. msvSDListItemMaster2 = Use(ShapeID)
4. msvSDListItemMaster3 = Use(ShapeID)
5. msvSDListItemMaster4 = Use(ShapeID)
6. msvSDListItemMaster5 = Use(ShapeID)
7. msvSDListItemMaster6 = Use(ShapeID)
Events Section:
8. EventDrop = IF(LISTMEMBERCOUNT()=0,DOCMD(2499),0)

As long as i enter the ShapeID manually into the Use() Function everything goes well and after i have placed the list "Signal" on the page the correct shapes will be shown.
But if i link the Use() function to the ShapeData value nothing happens. What did i wrong?

Attached you can find the stencil. The link to the shapeData i have not included because it didn't worked.  :-\

Thanks in advanced
webrosti

Title: Re: Custom List with linked data
Post by: Surrogate on November 10, 2021, 04:54:31 PM
Syntax of USE function
https://docs.microsoft.com/en-us/office/client-developer/visio/use-function?redirectedfrom=MSDN

How you define ShapeID?
Title: Re: Custom List with linked data
Post by: webrosti on November 10, 2021, 05:19:46 PM
Hello Surrogate

The ShapeID is the name of the mastershape which is stored in the stencil and by entering this manually into the USE() function everything works correctly.
"Only" the link to the shape data is not working. In the shape data i have entered the name of the mastershape as well.
Title: Re: Custom List with linked data
Post by: Surrogate on November 10, 2021, 05:32:18 PM
@webrosti,
As i know argument of USE function must be wrapped into commas quotes. Are you sure that in your case it is true ?

Just now i cant open your example  :-\
Title: Re: Custom List with linked data
Post by: webrosti on November 10, 2021, 05:48:21 PM
Hi

For example:
msvSDListItemMaster1 = USE("F1") is ok
msvSDListItemMaster2 = USE(Prop._VisDM_Focus1) is not ok (Prop._VisDM_Focus1.value = "F1")

any ideas?  :-\

Title: Re: Custom List with linked data
Post by: Surrogate on November 10, 2021, 07:07:30 PM
Quote from: webrosti on November 10, 2021, 05:19:46 PM
The ShapeID is the name of the mastershape which is stored in the stencil and by entering this manually into the USE() function everything works correctly.
How you check correct work ? This function usually used for
QuoteApplies the line pattern, fill pattern, or line end called name to the shape when placed in the LinePattern, FillPattern, BeginArrow, or EndArrow cell.
not for cells in user-defined cells section...
Title: Re: Custom List with linked data
Post by: webrosti on November 15, 2021, 11:09:58 AM
Hello Surrogate

It seems, that my idea is not possible so i have look for another solution.
Thanks for your support  :)
Title: Re: Custom List with linked data
Post by: Surrogate on November 15, 2021, 11:13:40 AM
Quote from: webrosti on November 15, 2021, 11:09:58 AM
It seems, that my idea is not possible
I just dont understand what is your purpose
Title: Re: Custom List with linked data
Post by: wapperdude on November 15, 2021, 04:16:52 PM
I also don't understand what you're attempting to do.

First, don't use the USE fcn.  If all you're trying to do is get a value entered into the User.msv(SDListItemMasterX (X being some number) then you could use GetVal fcn.

Beyond that, we need to know more about what you're trying to do...
Automatically create a list/populate list?  How do you determine number of members?  How do you determine shape for each member?  Is there user interaction to set each shape type?  Do you read from a custom Excel file?  That is, the order and type of each shape defined in the Excel file? 

Perhaps, upload a couple different samples of finished lists?