How to create a complex stencil

Started by Jennifer, March 12, 2022, 06:38:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jennifer

This is related to my other thread about the timeline. I thought I should start a new thread so that things don't get all mixed up.

I tried to follow the instructions on this page:

https://support.microsoft.com/en-us/office/create-save-and-share-custom-stencils-a4c2235c-677d-4117-9673-1fef0a0ee22f

I moved one of the timelines to a new page and made it into a group. Is the group part necessary?

In the Shapes window, click More Shapes, and then click New Stencil.



In the Shapes window, right-click the title bar of the new stencil, and then click Save As. I named it "Timeline Universe".



It then tells me to copy my shapes to the stencil. When I do that, I get the black circle with a slash icon and it will not copy.

What am I doing wrong?
Using Visio 2019, part of Office 365 on Windows 10

Paul Herber

Create the new stencil, then copy and paste the shape into it, then rename and save it. See if that makes any difference.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Jennifer

Quote from: Paul Herber on March 12, 2022, 07:18:34 PM
Create the new stencil, then copy and paste the shape into it, then rename and save it. See if that makes any difference.

No difference. I also tried copying just a single shape. Also blocked.
Using Visio 2019, part of Office 365 on Windows 10

Jennifer

I think I figured out what the problem was. I was trying to copy the shapes onto the "Timeline Universe" name. But I think that's the name of the stencil group. When I dragged it to the area where it says "Drop Quick Shapes here" (duh), it created what I think is a stencil named "Master.2" in that group.



If I drag that back onto the page, it works.

Now I just need to figure out how to edit it.
Using Visio 2019, part of Office 365 on Windows 10

Jennifer

OK, I now have a Stencil (Timelines) with 3 Master Shapes (00 Universe, 01 Planet Earth, & 02 Vertebrates). I was able to modify the Universe master shape. When I drag it onto a new page, the modification shows up. But it does not show up on another page where I dragged the master shape before I modified it.

What do I need to do to get all instances of a master shape to auto-update?

Thanks
Using Visio 2019, part of Office 365 on Windows 10

Paul Herber

The shapes you dropped before the mod are now based on an older master. If you look in the Document Stencil you will see the other master shapes.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Jennifer

Quote from: Paul Herber on March 12, 2022, 09:35:23 PM
The shapes you dropped before the mod are now based on an older master. If you look in the Document Stencil you will see the other master shapes.

Is there any way that I can get any modifications that I make to a master shape to be reflected in any and all instances of that master shape no matter when they were dropped? If it's really a master shape, then all of its derivative shapes should be identical. No?
Using Visio 2019, part of Office 365 on Windows 10

Jennifer

After a ton of searching, I found this page:

https://superuser.com/questions/1296912/refreshing-already-placed-ms-visio-shapes-after-editing-the-master-shape

It is fairly confusing. In one place, it says that previously dropped shapes will never update when the underlying (previously, apparently) master shape is edited:

QuoteI am looking at his problem right now and I have found out that the Master Shape in the stencils do NOT Update the shapes (and probably will never) just as you have mentioned.

But in another place, it says they will:

QuoteHowever in the Document Stencil where all the masters you used in the document (Masters that are still used (still linked) and others used in the past) are kept. If you edit THOSE masters, all the shapes linked to that master will UPDATE.

I don't understand this. I didn't know there were more than one set of master shapes. Does this second quote work? If so, can someone walk me through the steps?

🤔🤨😯
Using Visio 2019, part of Office 365 on Windows 10

Jennifer

Oh, I forgot to mention that at the top of that page, it says this will work:

Quote
0. Activate stencil which contain new masters
1. Select shape which you need replace in you diagram
2. Click on Change shape command
3. Select new master-shape which you want use rather than old selected shape

I found it curious that it uses a 0-origin numbered list 🤔, but I gave it a try anyway.

I created a test stencil and added a test master shape:



I'm not sure what "Activate the stencil" means, but I opened it and selected it. I then selected the shape

I then edited the master shape and dropped it again:



Following the instructions above, as best I understand them, I "activated" the stencil by selecting it then selected the previously dropped shape and clicked on Change Shape in the Editing section. I was shown a copy of the new green-blue master shape:



I clicked on it and got this error message.



I tried closing that document and Visio. Same result.

Did I do something wrong?
Using Visio 2019, part of Office 365 on Windows 10

wapperdude

Phew.  That was a lot to read.  I think that was over complicated.  So...
When you open stencil and then drag and drop a shape from the stencil, placing it on your drawing page, Visio makes a copy of the master onto the Document stencil.  If you just drag n drop or duplicate existing shape, they all have same master...even if they're on different pages.  So, if you want to change/update all of these clones, open the master on the document stencil and edit it.  Save and agree to update all the little minions.  Done!  Note.  You can edit the master on the stencil.  But those changes will not flush down into the drawing shapes.  But, a new drag and drop will have the change, and, it will have a different Doc stencil master.  The key is that the drawing shapes point to the Doc stencil not the originating stencil.  Hope this helps.
Visio 2019 Pro

Jennifer

Ok, now am I completely confused. I was fiddling around with my "master" shapes. I wanted to rearrange some shapes that were in a group. I selected the group and pressed Ctrl+u. I got this error message:



So there is a link from the page shape back to the master shape, but it appears to be a one-way link.

I think Visio should either enable the master links to update all linked shapes or rename them "Half Master Shapes".

This is really annoying.
Using Visio 2019, part of Office 365 on Windows 10

Jennifer

Quote from: wapperdude on March 13, 2022, 01:09:03 AM
Phew.  That was a lot to read.  I think that was over complicated.  So...

Yeah, I thought so, too. 🤔😣😥

QuoteWhen you open stencil and then drag and drop a shape from the stencil, placing it on your drawing page, Visio makes a copy of the master onto the Document stencil.  If you just drag n drop or duplicate existing shape, they all have same master...even if they're on different pages.  So, if you want to change/update all of these clones, open the master on the document stencil and edit it.  Save and agree to update all the little minions.  Done!  Note.  You can edit the master on the stencil.  But those changes will not flush down into the drawing shapes.  But, a new drag and drop will have the change, and, it will have a different Doc stencil master.  The key is that the drawing shapes point to the Doc stencil not the originating stencil.  Hope this helps.

I just ran a little test.

  * I created a shape containing 2 squares of different colors.
  * I opened the document stencil.
  * I copied that shape to the document stencil to become a master shape.
  * I copied that master shape to the page a few times.
  * I then edited the master shape in the document stencil. When I saved it, I was asked to update all copies, which I did. They all changed. Yea! 😍🤗

So, now I know how to do it using the document stencil, but that is only in that document, right? I cannot use those master shapes in any other document, right?

Is there a parallel procedure for a custom stencil that will work on any document? It's not critical for this project, but I plan to take some notes so I don't have to bang my head against the wall so many times in the future.

Thanks
Using Visio 2019, part of Office 365 on Windows 10

wapperdude

Just copy and paste the Doc master or a drawing shape to your new custom stencil.  If you subsequently edit the custom stencil master, that will only impact future drag n drops.  I am not aware of  any procedure that flushes the custom master changes into the drawing.  That can potentially wreak havoc to drawings.  Plus, it is added baggage when sharing.
Visio 2019 Pro

Jennifer

Quote from: wapperdude on March 13, 2022, 02:29:56 AM
Just copy and paste the Doc master or a drawing shape to your new custom stencil.  If you subsequently edit the custom stencil master, that will only impact future drag n drops.  I am not aware of  any procedure that flushes the custom master changes into the drawing.  That can potentially wreak havoc to drawings.  Plus, it is added baggage when sharing.

Hmmm... How is this different than custom code for Excel? If I write code that is to be used in just one workbook, I put it in a code module in that macro-enabled (.xlsm) workbook. If the code might be used in more than 1 workbook, I put it in an add-in module and make that available to whatever workbooks need it.

The code in the add-in module doesn't "wreak havoc" with any sheets. The author of the code has to be careful when modifying the code that it doesn't break any sheets that already use it. I have that problem right now with some code I wrote a long time ago that has a time parameter. The default units are seconds, because that was the units I was using when I initially wrote it. But time in Excel is usually in days, so that would be a better default. Now I have to find all calls to that function before I change the default. If I had done a better job initially, I wouldn't have this problem now. The same would be true of master shapes in a global stencil.

As for added baggage when sharing, that's possible, but it's pretty easy to move the code to the workbook if needed or share the add-in module. That added "baggage" certainly hasn't stopped Excel or Word from offering both local and global code modules. In fact, I can hardly imagine life without both.

This hasn't been a huge problem with Excel or Word, the 2 apps that I use the most. I can't see how Visio would be that much different.
Using Visio 2019, part of Office 365 on Windows 10

wapperdude

Wow!  This took a gigantic leap in a totally different direction.  I'm not going to explore coding /  macros, other than to say, when code is updated other than bug fixes, the new features can create backward compatibility issues.  That applies to updating masters in a custom stencil that is distributed, that is, not restricted to personal use.  To wit, get a stencil that has a red square that I always use in my drawings.  That master gets updated in the stencil, not by me, but by someone else, and is now a green rectangle.  If the next time I open my file, and this automatically updates all my red squares, well, that wreaks havoc on my drawing.  That was my point.

My 2nd point, if Visio doesn't c make copies of masters onto document srencil, then every stencil from which I chose at least one shape, has to be sent with my drawing file.  That is excess baggage.

But, the main point was the simple process that the doc stencil enables for editing in its in adulterer form.  Sorry if the explanation was confusing.
Visio 2019 Pro