Prop Fields for User Stencil

Started by TwoBeAss, April 09, 2024, 12:42:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TwoBeAss

Hi,
Hi,
I would like to add a User.Version cell to all my mastershapes. In order to not change all the User.Cell values separately with every update, I thought there might be a solution where I can write down the version number of my stencil and write a reference to that value in the mastershapes...

Thanks for your support...

wapperdude

I'm not aware of shapesheet solution to do this.  In order to not break link to the stencil, the version info must be pushed into the master before drag N drop. 

An alternative approach, albeit 1st time painful, might be use linked data / datagraphics.  Once setup, all you need to do is update the data, say, from Excel file.  The linking gets the data to desired destination.  So, for revision, just update the data.
Visio 2019 Pro

Yacine

Your description sounds strange.
If you update a master in the stencil and give it new revision number (in a user row), then all the newly dropped masters (becoming shapes in the drawing) will have that new revision number.
Older shapes will reference the master created previously in the drawing.
If you replace the shape by the new master than the revision cell should also update - that is if you haven't changed it in the shapes.
Yacine

TwoBeAss

Maybe i am misunderstood ;) i think its the language barrier  :-\

I have a stencil with a 10 different mastershapes and a VBA Part. If the mastershapes in the stencil and its corresponding VBA Code is updated, all drawings that want to use the new version, have to exchange the old references to the old mastershapes in order to get the updated VBA code working. I thought it is helpful, to have a usercell holding the version of the mastershape and be able to sort the old versions out and exchange them with the new shapes...


wapperdude

Perhaps part language.  But mostly details to help us understand what you have and what you're doing.  Here's what I think you have...
1) A stencil with 10 masters.
2) the stencil has a unique name, modified when an update occurs.
3) each master has VBA code attached to it.
4) when 1 or more masters are updated, the stencil is updated to contain the updated masters plus those that were not updated.  The count of masters on the stencil remains at 10.
5) A drawing may use updated code only if it uses updated master.
6a) if a specific master is updated, that applies to all masters identical to that updated type.
6b) correlary:  there is no mixture of updated/no cup dated masters of the same type.

Is that correct?  Assuming it is, adding a version entry might be useful.  But, the main issue doing that is existing drawing shapes don't have that entry.

It would seem, Yacine's suggestion is most straight forward.  Replace the master in the Document stencil with the updated master from the updated stencil.  All drawing shapes that point to the Doc Stencil master will be updated...unless they've been manually modified.

Visio 2019 Pro

Yacine

Yes, you misunderstood me.  ;D

Edit the master in your stencil by adding a type and a version field.
User.ShapeType = "So and so"
User.Version = "10.04.2024"

When you use this master in your drawing the shapes will carry this information.
And using VBA you can check for the shape type, then the version.

Tomorrow you will change all the shapes with revision 10.04.2024 by the new one 11.04.2024.

Now you may argue what about the old legacy drawings?
Write a macro that writes those two fields in the according shapes - you'll need to find a way to identify them once. In revision write "old" or whatever and do the replacement job.

But may be I did not understand. I'm getting older too. ;)
Yacine

wapperdude

#6
It's a bit easier than described.

Assume your drawing has shapes based on masters A, B, and C.  Maybe 6 copes of A, 27 of B, and 75 of C.  All have some User entries.  None have User.version nor User.date. 

Updated stencil, master A is updated with both of those fields added to existing User section. 

Now, open doc stencil, open master A to edit the master.  Delete it and replace with updated master. Save.  Close window. Yes to update the master and its shapes. 

The drawing will now have 6 updated A shapes.  The added rows get flushed into the drawing shapes.  It may not be necessary for a macro unless it is desired to have the extra User lines in shapes that aren't updated.
Visio 2019 Pro