Hi Vendril,
Happy new year to you too.
There were some minor errors in the code.
1) The formula in user.action was not written because the writing was inside the "IF cellsexists" statement. Since your master did already include an empty user.action row, nothing happened.
2) The master "desk" did not include the appropriate "CALLTHIS" formula in the drop event. This cell is near the bottom of the shapesheet.
3) I added a global constant "rotation" to allow for locking the angle of the sub-shapes to the page. This may not be the most elegant way, but it shows at least, how you can control the angle.
4) You forgot to add the user.type field in the laptop master. This prevented it from being deleted.
And here some thoughts regarding your questions:
Hardly important but the live update of shapes. On the original I could manually edit the shape data and it would change as soon as I exited the field. This wont matter in the long run as it will all be data link driven. Just wanted to note it.
corrected in 1)
With the single DG I have set so far (colour by label "group") I have to run the macro twice. After the refresh it changes the desk to a colour including sub shapes, but if I run the macro again it removes and places the sub shapes fresh on the desk.
I don't know your dialog, but there is a difference when formating a shape in the UI or by code.
In the UI the formating is applied to the shape and it's sub-shapes.
When you code, you modify usually only the according cell of the parent shape.
If you want this format to be applied to the child shapes too, you need to iterate through these shapes.
I noticed that the legend doesn't update itself after it's been placed. I'll look into a way to place it fresh after each refresh in the VBA.
Sorry, but I'm still on Visio 2007, so I couldn't open the vsdm and could not see the legend.
I tried editing the code to include my new desk2 shape but it doesn't want to drop the sub shapes on it still.
Addressed in 2)
I was hoping to do a "if its desk(original) then place subshapes at.., if its desk2(L shape) place them at ..." kind of thing.
It may look tempting to set up the drawing completely by code, but you may also thing about placing then subshapes at named control points.
This would have the additional advantage to have the sub-shapes easily move-able.
Text rotation is an issue for the desks. I want everything to be 0 degrees to the page.
Similarly to the angle of the sub-shapes, the text can be kept from rotating.
You can use the same formula, only the cell reference must be changed.
shp.CellsSRC(visSectionObject, visRowTextXForm, visXFormAngle).FormulaForceU = "=IF(BITXOR(FlipX,FlipY),Angle,-Angle)"
For my views I really need some advice on how best to represent the data without it getting too crowded. I was thinking along the lines of having the initial view just with the desks coloured as I have with the data graphic and a name on it. Then maybe on click have some of the other shape data show up/pop up or something. Not everything but maybe just select items like name, phone number, assets numbers? I'm not done much on text boxes but is this the idea?
On the above I've played some with the DG but as soon as the shape is rotated it all goes to hell which is why i'm thinking text boxes. You see from the page that I am using the space I am working with which is why iI don't really want to clutter up the page with every desks data at the same time.
The strategy on how to represent the data depends mainly on the purpose of the document and the way you make it available.
Printouts would generally have legends and the link to the shapes would be done by IDs placed on or near the shapes.
Interactive documents can display different types of information depending on user's choice.
For an interactive document, the initial choice would probably be where to put the smartness of the shapes, the shapesheet or the code.
Shapesheet solutions are easier to distribute and easier to handle (?). Hardcoded behaviour may be better for maintenance and scalability issues.
In a shapesheet solution the shapes could refer to global variables of the page.
eg: Hidetext = thepage!prop.hidePhoneText
In a coded solution, you would either modify directly the characters property of the shape or a custom property to display on the shape.
You may also consider whether to put the text in the desk shape, or the sub-shapes.
For my desk2 I tried to edit the workstation cubicle but so many groups it got confusing so I just decided to try making my own.
Wise solution
It's serviceable but IDK why the underlying sheet turned out to be a big off center rectangle and not a square like my desk. Worried about if this will impact things later on for some reason?
Didn't get this point.
My vsdm file is too big so I have uploaded the files to my dropbox. stencil, dataset workbook and the visio drawing. Shared folder is https://www.dropbox.com/sh/be24sz8brypcgx7/AADaKkMZ_iuc2YgSb-dVI8bua?dl=0
I could check the stencil, but not the drawing, because I'm still on V2007. Would be nice if you could save to V2007 in future.
Thanks again for all your help. I'm really enjoying this!!
You're welcome, it's a pleasure for me too.
PS: at this stage should I close this thread and open a new one in a different area?
We're usually not so strict, about forum rules, but it helps other members, when topics are clearly separated.
Please find enclosed the corrected stencil.
Cheers,
Yacine