Visio Discussions > ShapeSheet & Smart Shapes
SetAtRef et al.
spandex:
--- Quote from: wapperdude on March 13, 2015, 10:49:35 AM ---Setatref() is the most mysterious function in all of Visio. Appropriately, it has the least amount of documentation. It is definitely not something for dummies!
While you googled for Setatref, did you search this forum? There're many posts on the topic. Let me direct you here for starters, suspect you'll be back with more questions: [url]http://visguy.com/vgforum/index.php?topic=5968.msg24073#msg24073/url]
Wapperdude
--- End quote ---
You're right; I missed this thread. That's very helpful. It will take me a while to go through it. Thanks!
spandex:
--- Quote from: spandex on March 13, 2015, 09:58:15 AM ---I am looking for a "Tutorial for Dummies" on the SetAtRef.* family of functions. I have the Visio 2003 Developer's Survival Pack as well as a pair of entries from a Microsoft blog. Unfortunately, we dummies need a much more detailed explanation. Google did not have much to offer.
--- End quote ---
In case anyone is interested, here's what I'm trying to accomplish:
I want to be able to change the line rounding in two places and keep them synchronized: the standard Visio UI (invoked e.g. by Format | Line from the right mouse-click menu) and a custom property dialog (invoked by a DOCMD(1312) action as a result of a custom item from a right mouse-click menu).
To complicate things further, I want to add another item to the RMB menu that will enable/disable Rounding. If unchecked, the value of zero will be used. If toggling from unchecked to checked, the most recent non-zero rounding value (from either of the two sources) should be used.
Thanks!
spandex:
--- Quote from: vojo on March 13, 2015, 11:14:38 AM ---it would be great if somebody on this forum could write a nice tutorial for posting on visio guy.
What the intent is in general
-human words not abstract speak such as "container", "object", etc
- Illustrative examples showing both the formula and result image/shape/display
- Vary the examples to see what its actually doing
--- End quote ---
That would be fantastic! I imagine that it would be quite an undertaking. I could easily see a whole chapter in a book devoted to it, so perhaps 10-20 pages would be a reasonable estimate.
wapperdude:
@ Spandex: couple of things re what you want to do.
1. Bad news: SETATREF won't work for what you want to do. There are only a limited number of shapesheet entries for which it can be used: https://msdn.microsoft.com/en-us/library/ff765523.aspx .
2. Good news: you don't need it. What you do need to use are
A. IF fcn to do the conditional checking...
B. The SETF(GETREF()) functional construct.
Basic info on these, and all shapesheet info can be found at the referenced link. Search the forum for setf for examples.
Wapperdude
wapperdude:
Correction! MS lied. SETATREF can be used for the corner rounding...I decided to try it since that is a UI parameter.
So, for example, you have shape1 and shape2. Open shape1 shapesheet and scroll to the Line Format section. In the Rounding cell, enter this formula: =SETATREF(Sheet.2!Rounding). That's it.
The cool thing, it's bi-directional. If you select shape1, change its corner rounding, shape2 inherits that rounding. In addition, if you select shape2, change its corner rounding, shape1 inherits the rounding.
Moral of the story...try things before making suggestions ::) ...and, don't believe everything you read! :o
HTH
Wapperdude
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version