Visio Guy

Visio Discussions => General Visio => Topic started by: Mike54 on May 24, 2018, 12:54:24 PM

Title: Boundaries outside image
Post by: Mike54 on May 24, 2018, 12:54:24 PM
Not sure of my terminology here but I have created some shapes to represent network equipment which I then save as .emf so the text and line size stays proportional to the image when it is resized. That all works great but then when I try to fit the image into a cabinet diagram I find the external boundary of the object is outside the boundary of the image making it very difficult to align correctly.

Simplified: If I draw a square the boundary is the outside line of the square. If I then save it as a .emf and copy it back in the boundary is now outside the square. How can I prevent this?
Title: Re: Boundaries outside image
Post by: wapperdude on May 24, 2018, 02:24:45 PM
Why are you converting to a graphic format and bringing it back I to Visio?

Wapperdude
Title: Re: Boundaries outside image
Post by: Croc on May 24, 2018, 02:43:26 PM
Take the design of VisioCafe shapes as a model. They make good shapes.
Typically, the shape is a group consisting of Visio shape + EMF. Visio shape is the substrate and sets the size of the group. The EMF is positioned closer to the center and does not affect the dimensions.
In addition, often the group has a 1D shape behavior for fast rack mounting.
Title: Re: Boundaries outside image
Post by: Mike54 on May 24, 2018, 02:55:13 PM
I use VisioCafe shapes a lot and yes that would work. As the out side edge is usually just a rectangle I could set it's lineweight as a ratio of the width.
Title: Re: Boundaries outside image
Post by: Croc on May 24, 2018, 03:03:43 PM
You can also try to use or modify the "Converter" macro from this file. This is similar to the method you want to apply.
Title: Re: Boundaries outside image
Post by: Croc on May 24, 2018, 03:14:44 PM
.
Title: Re: Boundaries outside image
Post by: wapperdude on May 24, 2018, 11:40:26 PM
Back to my original question...why?

I understand the desire to scale text, line width to shape size, but this can be done within the shape sheet.  This avoids unnecessary grouping and dealing with Visio to graphic to Visio artifacts. 

For text scaling:  http://visguy.com/vgforum/index.php?topic=6897.msg28789#msg28789 (http://visguy.com/vgforum/index.php?topic=6897.msg28789#msg28789)
http://visguy.com/vgforum/index.php?topic=5261.msg20789#msg20789 (http://visguy.com/vgforum/index.php?topic=5261.msg20789#msg20789)
http://www.visguy.com/2007/08/21/text-resizing-with-shapesheet-formulas/ (http://www.visguy.com/2007/08/21/text-resizing-with-shapesheet-formulas/)
http://visguy.com/vgforum/index.php?topic=6897.msg28789#msg28789 (http://visguy.com/vgforum/index.php?topic=6897.msg28789#msg28789)

For line width scaling there are similar techniques.  For example, in the Line Weight cell, you could use a formula like:  =BOUND(MIN(Width,Height)/10 pt,0,FALSE,1,48)*1 pt.  This formula uses the bound function to limit the minimum line weight to 1pt, and a maximum of 48 pt.  These can be varied as needed.  Additionally, it uses the lesser of width and height to determine which shape attribute will be used.  This avoids creating a very wide line that would completely fill in the shape.  Finally, an arbitrary scaling factor of 10 pt is used.  This can also be changed as needed.

HTH
Wapperdude
Title: Re: Boundaries outside image
Post by: Croc on May 25, 2018, 05:49:25 AM
Not only scale...
Such shapes for realism contain hundreds of nested shapes. This is very much. The document with such shapes takes a large size and works slowly.
After the transformation to EMF, these characteristics are much better.
Title: Re: Boundaries outside image
Post by: wapperdude on May 25, 2018, 02:51:42 PM
@Croc:  Sure.  Good points.  In both the case of wanting a realistic representation of a piece of gear, using an image is fairly common, and for highly complex shapes, that makes sense too.  Didn't get the impression that either of those were happening...my answer was too brief.

Wapperdude
Title: Re: Boundaries outside image
Post by: Nikolay on May 25, 2018, 04:18:32 PM
Visio shapes provide a lot of flexibility, but this comes at cost of performance and file size.
If you don't need smart behavior (just resize /reposition), but have a shape with many tiny details, and want your drawing to still be vector, so that resolution is not lost, emf is the sane choice, which is also confirmed be hundreds of Visio cafe stencils created using this technique. CISCO switch as native Visio shape would consume 10 times more space and would be 10 times slower.

It would be good to see some in-built feature to "optimize" shapes (right click shape - click "optimize"/"de-optimize"), that could do that operation of converting shape into a simple vector image (emf) easier. While keeping the box sizes, so that issue of the topicstarter doesn't happen.