Recent Posts

Pages: [1] 2 3 ... 10
ShapeSheet & Smart Shapes / Re: Master Formula Chain
« Last post by LostTime77 on January 22, 2022, 11:48:56 PM »
Code is pretty simple. Here is the VS solution if anyone is interested. Code is literally provided as is. First time doing an add in. Make sure not to run the solution unless you want the plugin installed. If it installs you can remove it in the developer tab through the com add ins. Additionally in the startup routine there is a line that when commented out opens up a test document on my machine, so I didn't have to keep manually opening a doc every debug session. Change it to the proper path if you want it to open a doc on debug.

(Don't care if you know my first name. Can't be bothered to make it fancier to hide my name)

Latest stuff:
  • VS Community 2022
  • Visio 2021
ShapeSheet & Smart Shapes / Re: Master Formula Chain
« Last post by wapperdude on January 22, 2022, 11:27:21 PM »
I was aware  of your attention to develop code, but my curiosity took over.  I would agree with doing a code solution based upon the scope of your task.  That was pretty fast development.
ShapeSheet & Smart Shapes / Re: Master Formula Chain
« Last post by LostTime77 on January 22, 2022, 11:05:27 PM »
I highly appreciate you digging into this. I am always amazed by good people and how they either truly try to investigate or do a bunch of leg work for others.

However, I just spent a few hours making an addin using VS and C# that does exactly what I want. Basically on any master shape you can send a queue marker event which gets picked up by the addin. So drop a shape into the document from a master and you get an action menu. The event formula is such that it passes the page name and id of the currently selected shape. Then the plugin looks for all cells in the user property section with a g_ prefix. It then pulls those properties out into a list and a WPF window is created with a datagrid. You can then modify the values of those constants. Once you click "OK" on the window, the code iterates through every master in the document. It then finds the corresponding document shape within the master and updates all of the user cells from the datagrid with the new values.

This allows all the masters to use local user cells for their formulas and all the g_ prefixed properties will be updated at once by the addin. Tested and works very well.
ShapeSheet & Smart Shapes / Re: Master Formula Chain
« Last post by wapperdude on January 22, 2022, 09:59:42 PM »
Attached is slightly different variation of previous file.  The top level parent of the nested groups may be double clicked to open the shape data window.  This allows entry of new values into the Document shapesheet, including text.  Note, manual/GUI text entry will clobber the functionality of this shape.

Drag N Drop still works.
ShapeSheet & Smart Shapes / Re: Master Formula Chain
« Last post by wapperdude on January 22, 2022, 04:44:45 PM »
Ok.  bit of update.
Open the shapesheet for the group master shape.  Scroll to the FillForegnd entry.  As you double click the, uh, double click shape, the FillForegnd entry actually does toggle.  But, the shape itself doesnot update it's fill. As configured, the FillForegnd cell checks the User defined variable, and sets the color using an IF statement.  It appears, that if the IF statement is moved to the User entry, and then using SETF(GETREF()) construct to push a value into the FillForegnd cell DOES preserve the DOC variable functionality for Drag N Drop.

The User cell formula becomes:  =TheDoc!User.docVar+IF(TheDoc!User.docVar,SETF(GetRef(FillForegnd),4),SETF(GetRef(FillForegnd),2))

The 1st part of entry allows other cells to read, the 2nd part pushes value into the FillForegnd cell.
ShapeSheet & Smart Shapes / Re: Master Formula Chain
« Last post by wapperdude on January 22, 2022, 04:16:03 PM »
Out of curiousity, I cobbled together the attached file.  It is by no means a complete nor exhaustive study wrt nesting grouped shapes and using variables defined at the Document level.  But, it does provide a base from which to explore.

Group construction:  there are two methods to create a group.  1) select a bunch of shapes and group them, and 2) select a shape, convert to group and then add shapes to the group.  For this file, the 2nd approach was chosen.  Once a basic group structure was created, it was then dupliccated.  Then, the 1st group was added to the 2nd group, and so on.  I stopped with 4 nestings giving an equivalent of 5 levels.  Within a group, User section was introduced to hold a variable.  Depending upon the desired dependency, the variable might look at the parent shape, and, typically, the parent shape might either look at the page or the document.  Entries are either true or false.  These displayed in the shapes.  In some cases, I made the fillcolor reflect the status of the User variable.  Just enough to demonstrate functionality.

The placements may be either copy/paste or drag and drop from either a Custom defined stencil or the Document stencil.  The only behavior anomaly shown was with the drag and drop method when Document based variables were referenced.  For copy and paste, the Document based behavior was properly functioning.  In all cases, if you open the Doc shapesheet, you can see the User variable value change, but the drag and drop shapes just don't update.  I did not pursue this any further.

ShapeSheet & Smart Shapes / Re: Master Formula Chain
« Last post by LostTime77 on January 22, 2022, 12:21:23 PM »
Humbug. I did actually happen upon the Russian thread you are referencing, but my example / use case was slightly different. I only skimmed that thread.

Guess it's back to making an addin. From what I have found, the issue does not seem to be present when using local data that is all present in the master. For example, if I define a constant in the master (say 5in) then use that cell in a chain within the same master, things seem to work fine. If I update the original constant in the master, everything propagates through the chain all the way to the shapes in the document. Take note though that I don't think I have a need for long chains. I have only tested with chains of about 3 or 4 in length. Realistically my chains will be a maximum of 2 or 3. Now, for some reason when the original constant is within another page or the doc shape sheet, used as the first cell in the chain, the chain stops the update after the first cell. It seems maybe there is a bug with non local data.

Alas, my intention is to be able to build master shapes that use global constants. When I update those constants, all the masters and shapes based on those masters will update. I had a few ideas to get by the limitations such as macros or an addin. I really hate VBA with a passion. Not so much the language though! The fact MS has been dragging along this old editor and not supporting a modernization effort for 2 decades. Then citing "We will be keeping VBA for a long time yet, because lots of people use it and everybody knows it." Guys, you are contradicting yourselves.

Anyhow, what I will be doing is developing an addin. It will exist as a ribbon button. The only thing it does is when you click it, it brings up an input dialog. You input a shape sheet property you want to change and its new value. That's it. The addin then iterates through all the masters and sets that property to the new value. This way I can develop all the masters with local properties of the same name and update all the properties at once as if they were global constants. Since visio seems to like local data in the masters, this should work fine. I ran some initial tests doing it with a VBA macro and some hardcoded values to test it quickly, and everything works.
General Visio / Re: Colour palettes
« Last post by wapperdude on January 22, 2022, 10:50:03 AM »
As "I don't get out much", a question occurs to me, are there other drawing package available that accept entering a single numerical value for color choice?  My limited exposure hasn't encountered that.  But, if so, follow-up questions are:
1) does the numbering/color definition from app to app remain consistent?
2) within a single app, is there consistency from file to file and/or " machine to machine"

I would think that repeatability is of paramount importance, and thus, if any such numerical - color equivalency exists, it must be defined from within the app itself.  I am quite amazed that Visio doesn't barf up an error for such entries.  Clearly, there's some interpretive functionality mechanism, but I don't believe that's coded into Visio witnessed by other Office apps???.  Based upon the observable results, my attempts seem to indicate there may be some rounding/truncation type conversion error going on.  That would be influenced by machine design and capability...CPU type/speed, ditto RAM, pwb layout, thermal manag, or execution race conditions???

Happy hunting!
Deployment / Re: Continuing support for .vsx format stencils
« Last post by Paul Herber on January 22, 2022, 10:37:33 AM »
Thanks for your thoughts. I have made an executive decision and .vsx format has now left the building for future updates.
Deployment / Re: Continuing support for .vsx format stencils
« Last post by wapperdude on January 22, 2022, 10:22:38 AM »
I suspect drop it.  The final say will be users impacted by the decision.  At least, don't put any new development effort into that format.
Pages: [1] 2 3 ... 10