Hi,
I have some shapes in Visio (buttons), each button has text on it, e.g. ButtonName. When i press the button, I want to copy the Shapetext into a variable using SetVar.
I've tried SetVar - Variablename:SHAPETEXT(theText) and Setvar - Variablename:CopyShapeText
I have anothershape at the bottom of the screen that displays the set variable. So I just want to show which button I've pressed.
Thanks
Chris
Hi Chris,
If you did not follow the course already, I highly recommend to follow the Visual Overview course: Visualization - DataMiner Dojo
You can also find a lot of information on our documentation pages: Visio drawings | DataMiner Docs
You can do it by setting the value of the SetVar property to this formula:
="MyVar:"&SHAPETEXT(TheText)
Or if you are familiar with VBA you can update your shapedata automatically through macro code like this:
You might want to look into the stencils we have available from https://skyline.be/skylicons/ there is a download button at the top of the page to download a zip package. That one contains already some advanced shapes, maybe you want to look into that on how they achieved it. Hope it helps.
The stencils allow you to configure advanced shapes by placing some shapedata on the group
Added an example of VBA code to get you started, hope this helps you
Hi Chris,
The answer was updated. Can you let us know if this still doesn’t answer your question?
Thanks
I’ve got the buttons working, but I need to copy the text displayed on a button (Button1 in your example) to a vaiable, hence using the Visio builtin SHAPETEXT macro