Draw a shape around selection

Started by kiler40, February 09, 2015, 09:58:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kiler40

Hello All,
I have a question if is possible to draw a shape around selection. Something like outline.
I use the free-form tool to create this shape. But i was wondering if anyone have an idea for faster drawing.

For Sure it is impossible for me to do it  :-[




Visio Guy

Hi Kiler,

I think you want to do this with code...

This is a start: with your line selected, try:

Visio.ActiveWindow.Selection.Offset(0.125)

where 0.125 is inches, (1in = 25.4 mm)

A place to start, anyway!
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

kiler40

Ok. This is a interesting start :)
but how to close these lines as a shape.
Another issue. if it is a closed shape (circle, square, etc.) it creates 2 more shapes on outside, one inside.

Little more help pls :)

Visio Guy

Yes, you will get two shapes. You can find these using Visio.ActivePage.Shapes( Visio.ActivePage.Shapes.Count ), and Count - 1.

I don't have the complete solution, I am just giving hints that make sense. I've got other things to do!
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Visio Guy

If shapes aren't closed, you should be able to get the endpoints and draw lines between them, then Fragment the whole thing to create a shape (or draw a polyline yourself)
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

kiler40

I`m not so good yet in coding. i`m really a basic user.
So this is too much for me.  :-[

Visio Guy

Maybe some of the other guys have time to help! :)
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

wapperdude

Do you need an outline, or could highlighting suffice, .i.e.,  change linecolor, lineweight?

Wapperdude
Visio 2019 Pro

kiler40

Outline for sure ... :/ line color or weight i can manage to do by my self.

Yacine

Hi Andrei,
,,the Master" gave you some serious words, about asking too much.
And whilst agreeing with him, I do confess, that your specific problems are always (often) so challenging and interesting, that I find myself working them out for you.
Guy! You need to get involved and learn to code!
This is the very last time I do this for you! Seriously! Get some VBA courses!

This said, here's what I worked out.
For requests like yours, one would try out the steps to get the result by different shape operations on the drawing itself.
Once this done, one would record a macro and repeat these operations.
The so recorded macro will then need to be cleaned from absolute references. There's some research work involved to get the right routines, working with the right parameters.
And the most important thing in this case, would be to have control over the shapes involved.
A good place would be a separate window, where only the specific shapes are involved.
I did chose a master in the document stencil for this task. I do create a new one, populate it with a copy of the shapes in the selection, then do all the join, segment and fragment operations on it.
After finishing these operations I delete the master and paste the result in the drawing.
My work does not consider the position to paste the outline in. You need to center the view on the selection first. That's however a feature you can (should) add.
Yacine

Visio Guy

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Nikolay

You could also try "glow" effect.. (Visio 2013) has similar look:

Yacine

#12
@Nikolay,
I like your LICEcap very much, thanks for the info.


@Master,  8)
Yacine

wapperdude

I want to play too!  Can I???

Meanwhile, back to the freeform tool.  Not sure what the fuss is about.  Seems like the obvious, straight-forward solution.  The outline can be made very quickly with a little initial effort. 

Not sure where it is in the newer, "sophisticated" versions of Visio, but in V2007 go to menu bar>tools>options.  Click on Advanced tab.  Under Freeform drawing, set Precision to max Looseness, i.e., Value =10.  Then set smoothing to something like a value of 7.  Click OK.

Now draw your outline.  Should be a nice, smooth contour.  Take you all of 30 seconds or less.   If this meets your needs, thank Jojo, ooops, that's from a Beatle's song, thank Vojo.   As I recall, he pointed this out sometime ago, in a post, far, far away.

Wapperdude.

@Yacine:  "Master Yoda" said I could play.   :o   LOL
Visio 2019 Pro

Yacine

 ;D Nice. Both the Yoda and the freeform looseness.


To understand Kiler's problem, you need to remember that he makes those big car electrification diagrams with dozens (hundreds?) of shapes (see the upload picture in his first post)
Having a tool, that follows smoothly the outline of a shapes selection to highlight groups is certainly easier to handle than the freeform tool ... and looks better on professional documents.
Yacine