Avatar of bsharath
bsharathFlag for India

asked on 

I have black bars in visio which i have used to create my whole visio drawings. Now i feel they are over sized. is there any way i can change the size with a macro.

Hi,

I have black bars in visio which i have used to create my whole visio drawings. Now i feel they are over sized. is there any way i can change the size with a macro.

I have 20 files that i need to change and its going to be very difficult to do it manually. Any help is of great use.

Regards
Sharath
Microsoft Visio

Avatar of undefined
Last Comment
bsharath
Avatar of Scott Helmers
Scott Helmers
Flag of United States of America image

See whether this comes close to what you want. Each of the wall sections is actually a box not just a line, so it's necessary to adjust both the width of the box and the line weight. I've picked 1.5 mm and 2 pt, respectively; you can change those to other values if you'd like.

BTW, I kept this really simple; it only changes individual walls not ones that have been grouped together. If you want to change those too, just ungroup them and rerun the macro.
Sub ChangeWallWidth()
' changes line weight and width of box shapes use as walls on floor plan
    Dim pg As Page
    Dim shp As Shape
 
    For Each pg In ActiveDocument.Pages
        For Each shp In ActivePage.Shapes
            If shp.Type <> visTypeGroup Then
                If Left(shp.NameU, 3) = "Box" Then
                    shp.CellsSRC(visSectionObject, visRowLine, visLineWeight).FormulaU = "2 pt"
                    shp.CellsSRC(visSectionObject, visRowXFormOut, visXFormWidth).FormulaU = "1.5 mm"
                End If
            End If
        Next
    Next
    
End Sub

Open in new window

Avatar of bsharath
bsharath
Flag of India image

ASKER

Thanks Scott i ran the macro but nothing changed. I think these are just bar's they just have 2 side selctors when clicked on them.
Attached is the picture of the bar

ScreenShot039.bmp
Avatar of Scott Helmers
Scott Helmers
Flag of United States of America image

I used one of the floor plans we were working on a couple of months ago. Why don't you send me a drawing that contains the lines in question and I'll take a look at it tomorrow (I'm off to bed now).
Avatar of bsharath
bsharath
Flag of India image

ASKER

ok thanks have a good night...
Attached is a sample file

1st-floor.txt
ASKER CERTIFIED SOLUTION
Avatar of Scott Helmers
Scott Helmers
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of bsharath
bsharath
Flag of India image

ASKER

Thanks Scott this is excellent worked fine...
One question .Is it possible to reduce the size less that "1"
Need your help on these please...
http://www.experts-exchange.com/Microsoft/Applications/Microsoft_Visio/Q_23588581.html
http://www.experts-exchange.com/Microsoft/Applications/Microsoft_Visio/Q_23588585.html
 
Avatar of Scott Helmers
Scott Helmers
Flag of United States of America image

Yes -- you can set line width to less than one, e.g., .75
Avatar of bsharath
bsharath
Flag of India image

ASKER

Hi Scott the attached is a sheet where i am not able to resize the bars. I have 6 of such pages...
HK.vsd.txt
Avatar of Scott Helmers
Scott Helmers
Flag of United States of America image

That's because the lines on this page aren't lines -- they are actually intelligent wall shapes from one of the Visio stencils. Took me a few minutes to figure out how to change them but this code does it.

The value of "0.25" is not a point size for the line as it was in the line thickness code; you can substitute other values if you want the walls to be thicker or thinner.
Sub ChangeWallThickness()
' changes line weight for lines used as walls on floor plan
    Dim pg As Page
    Dim shp As Shape
 
    For Each pg In ActiveDocument.Pages
        For Each shp In ActivePage.Shapes
            If shp.CellExists("Prop.T", False) Then
                shp.Cells("Prop.T").FormulaU = "0.25"
            End If
        Next
    Next
End Sub

Open in new window

Avatar of bsharath
bsharath
Flag of India image

ASKER

Thanks a lot Scott....
Avatar of bsharath
bsharath
Flag of India image

ASKER

Scott i have some maps as attached. How can i reduce the size of these bars
They are not reducing with the 2 macros you gave me.

ScreenShot058.bmp
Avatar of Scott Helmers
Scott Helmers
Flag of United States of America image

Unless you have hundreds like this, I would just delete them and replace them with lines you can control.
Avatar of bsharath
bsharath
Flag of India image

ASKER

ok scott. I shall replace all the bars in such files to the bars that can be managed with your script ...Thanks...
Microsoft Visio
Microsoft Visio

Visio is a diagramming and vector graphics application that is part of the Microsoft Office family that allows the user to create diagrams for organizational and planning purposes. The Premium edition has additional templates for more advanced diagrams and layouts, as well as capabilities intended to make it easy for users to connect their diagrams to data sources and to display their data graphically, as well as intelligent rules, validation, subprocess (diagram breakdown). one-step connectivity with Excel data, information rights management (IRM) protection for Visio files, modernized shapes for office layout, detailed shapes for site and floor plans, modern shapes for home plans, and IEEE compliant shapes for electrical diagrams.

2K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo