Author Topic: Prevent a shape from being added to containers  (Read 355 times)

0 Members and 1 Guest are viewing this topic.

rezingg

  • Jr. Member
  • **
  • Posts: 34
Prevent a shape from being added to containers
« on: June 16, 2022, 05:55:10 PM »
Is there a shape setting to prevent that shape from being automatically added to a container?
I know I can lock a container so shapes are not added to it, but I am looking for a setting in the shape that is dropped, not the container.

Here is the problem. I have a bunch of containers on a page. Now I'd like to draw a rectangle around a part of that page (around a few containers).
Whenever I do that, the container onto which the centroid of the large rectangle falls will automatically add the rectangle to itself and increase in size to fit the large rectangle. NOT wat I want. I would like the containers to keep their behavior to automatically add shapes that are dropped onto them and increase in size, if needed. But I want to set some property on the large rectangle (before I drop it over the containers), such that this particular shape is not being added.

Thanks for your help!

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4367
  • Ideas Visio-lized into solutions
Re: Prevent a shape from being added to containers
« Reply #1 on: June 17, 2022, 02:05:55 PM »
Not aware of any setting to do this.  What you might do is draw your rectangle off-page, and then send it to the back.  Now you ought to be able to move, rezize, position the rectangle as desired.  Disclaimer:  I've not tried this.
Visio 2019 Pro

rezingg

  • Jr. Member
  • **
  • Posts: 34
Re: Prevent a shape from being added to containers
« Reply #2 on: June 21, 2022, 12:55:27 PM »
Unfortunately the order does not seem to matter. Even if I first push the rectangle to the back, as soon its centroid is moved over one of the containers, that container will grab the shape (the rectangle).
The only solution I found, though not really what I want, is to use yet another container as the large rectangle...

Yacine

  • Hero Member
  • *****
  • Posts: 2950
Re: Prevent a shape from being added to containers
« Reply #3 on: June 22, 2022, 12:11:00 AM »
The only solution I found, though not really what I want, is to use yet another container as the large rectangle...
Very good idea. Supress the title and you're done.

There are other possibilities, but they require prepared shapes.

1. Use the fields user.msvSDContainerExcludedCategories or user.msvSDContainerRequiredCategories depending on your preferred scenario.
Don't ask for more details, I'm not a container specialist, but here is a starting link.
https://techcommunity.microsoft.com/t5/microsoft-365-blog/custom-containers-lists-and-callouts-in-visio-2010/ba-p/237586

2. Using some clever settings at page and container level.
- have a prop field for the page that switches the catching of containers. eg prop.container_catch / type=boolean
- use only containers from your stencil with the following setting:
  user.msvSDContainerLocked = thepage!prop.container_catch
  Now, when you want to draw around the containers set the prop.container_catch to False first, then draw.
  and vice versa when you want to use the catch feature of the containers turn it to True.
Yacine

vojo

  • Hero Member
  • *****
  • Posts: 1670
Re: Prevent a shape from being added to containers
« Reply #4 on: June 22, 2022, 02:21:14 PM »
so I guess after all these releases with container support, MS did not make the behaviors of "add on drop" and "accept drops" work for containers???  (developer ==> behavior ==> add on drop / accept dropped shapes)

I probably being really obtuse, but I could never figure out what containers do that groups does not do.

Yacine

  • Hero Member
  • *****
  • Posts: 2950
Re: Prevent a shape from being added to containers
« Reply #5 on: June 23, 2022, 05:23:56 AM »
so I guess after all these releases with container support, MS did not make the behaviors of "add on drop" and "accept drops" work for containers???  (developer ==> behavior ==> add on drop / accept dropped shapes)

I probably being really obtuse, but I could never figure out what containers do that groups does not do.

A lot of truth, but not quite right.

So you're asked to find a solution for grouping shapes and do funny things with them - like displaying them as list, providing a title, requiring or excluding certain types of shapes, automatic resizing , etc.

So you start with groups and realize that you need to tweak them. Not only are they not only groups, with a lot of shapesheet stuff going under the hoods, but you realize too that you need some automatically running routines in the background.

Things going on and developing, you are now with a customized version of an otherwise called group. What about calling it "Containers" and let your employer sell it as new feature?
What at the end of the day it really is. Think of the timeline solution.
« Last Edit: June 23, 2022, 05:32:16 AM by Yacine »
Yacine

Bork

  • Jr. Member
  • **
  • Posts: 28
Re: Prevent a shape from being added to containers
« Reply #6 on: July 20, 2022, 03:36:37 PM »
A simple fix would to put the large rectangle on a background page