How to set default line weight, fill (no fill) visio 2013

Started by ricoma, January 15, 2016, 05:02:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ricoma

I created a template file for my cad drawings and saved it with a specific line weight. Also rectangles and circles should have no fill. I set line weight and fill and saved as vstx template. Visio is accessing the right file because I rename it.  When I start a new drawing with that template I have to go and change the line weight and fill every time. I am new to visio so must be missing some step in the template creation process.

JuneTheSecond

#1
Some times asked question.
Please check Document.Gestureformatsheet property.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

ricoma


JuneTheSecond

Includeed in Visio VBA.

Try a macro like a ...

Option Explicit

Sub test()
    ActiveDocument.GestureFormatSheet.Cells("LineWeight").FormulaU = "3 mm"
    ActiveDocument.GestureFormatSheet.Cells("FillPattern").FormulaU = "0"
End Sub


Best Regards,

Junichi Yoda
http://june.minibird.jp/

ricoma

Sorry Junethe2nd, Frankly I can't believe this is a complex issue. I just want visio to open with a specific line weight and fill. Every single cad program I use has the ability to set up a drawing environment the way you like it, then save it as a master template. Are you saying this is not possible with visio, unless you can write a program?

JuneTheSecond

Try to search answer in the web.
Many people are  asking this issure..
But there is not a perfect answer.
I am just one of such a people.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Yacine

Hi Ricoma, don't blame us on Visio's inefficiencies. We're just trying to help.
Junichi is right, when saying that it is not easy in Visio and best is to use VBA.

But this is not the whole truth.
At least for the line styles of the connectors, if in your document stencil (shapes/document stencil) theres is a connector shape, you can format it to almost any style you need (line weight, colour, ends, etc.).
The standard connector you will then use, will inherit this style.
If the master in the stencil is missing, just drop a connector in the document stencil, open it by double click, then format to your needs.
As for other properties (font, filling, etc.) I suspect that Visio uses the standard styles (to find as such in the drawing explorer). These styles reference each other in a hierarchic way. - I have never found the patience to investigate this in depth, but playing with "only text", "none", "Standard" and so on, will enable you to define exactly what you're looking for. - not as comfortable as in other tools, but still available.
Now it's your turn. Let us know how you get along and let the forum participate in your discoveries  ;) .

Cheers,
Yacine
Yacine

JohnGoldsmith

Hi,

I think I agree that it should be easier to set defaults for the primitive drawing tools. 

My understanding (and this is just from observation) is that the primitive drawing tools (rectangle, ellipse etc) get their values from 'Normal' style, which inherits from 'Theme', which in turn uses the THEMEVAL function.  THEMEVAL returns the value in 'NoStyle' (not visible in the UI) when a theme is not applied, and a default has not been set. 

Any changes that you make to the drawing tools fill, line, when no shapes are selected get applied to the GestureFormatSheet, which is a hidden shape (and property of Document).  However GestureFormatSheet values aren't persisted on save and so the next time you open the file, GestureFormatSheet will again reflect whatever's in NoStyle (via Theme and Normal styles).

So your options, it seems to me, are either:

       
  • to set the default values you're after via code as Junichi suggests
  • edit Normal or Theme styles as per Yacine's advice
  • or to manually edit the NoStyle values in your template's XML (see attatched file)
I appreciate that none of these options might be what you're looking for, but it is where we are I'm afraid. 

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

ricoma

Thank you all for the input, I appreciate it. I understand what I'm up against. Bearing in mind that I am a complete newbie to this program. What is VBA and how do I get it on the screen to make the changes you people are talking about.

JohnGoldsmith

Hi,

I would have thought that the best option is to create your default blank template and then edit the 'Theme' style (manually) as per Yacine's suggestion.

To do this:

       
  • make sure you have Developer mode turned on (right click on the ribbon tabs to customize and ensure Developer tab is checked)
  • create a new blank drawing
  • open the Drawing Explorer (Developer tab / Show/Hide / Drawing Explorer)
  • expand Styles node and right click on 'Theme' and click Show ShapeSheet
  • navigate to the line / fill format sections and anywhere you find a 'THEMEVAL()' function you can edit the function as required giving the second parameter your own default value.  For example FillForegnd = THEMEVAL(,RGB(200,80,80))
  • close the ShapeSheet and save your new blank document as a template type (.vstx)
You can then double click the template file to create a new blank drawing based on it and the drawing tools should then reflect the changes you made in the Theme style.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/