visio noob needs good title block

Started by perry59, November 04, 2010, 06:00:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

perry59

First, I am pretty new to visio so I have a lot to learn. I came to it from an Autocad background where I did extensive customization. I'm hoping I can do some similar things with visio.
What I need first and formost is the ability to easily insert a custom title block/border into a drawing, and easily edit its textual attributes. I already have the title block/border in both my template and in a stencil. So that part is done, and its easy enought to drag from the stencil into an empty drawing.
The problem is editing the text in the title block. Its arcaic. Right now you have to ungroup (explode in Acad parlance) the title block in order to edit the text. I hoped I could add custom properties to the title block (or current sheet) and bring up just one form to edit all the text in the title block. This does not seem possible though. It seems custom properties can be assigned to shapes (lines, rectanges, etc.) or at the sheet level. So I would have to add a property to each piece of text, which is no help. It seems that a piece of text can not aquire a property from the sheet level.
What I want to do is to click somewhere on the title block and invoke a form which contains ALL the editable text in the title block in one, easy to use location. NOT have to zoom in to the title block and edit each one individually. Is this possible? Im having trouble accomplishing this through the use of fields. Perhaps via VBA? Any help or examples would be greatly appreciated! Thanks
what, me worry?

wapperdude

#1
There are two features that you might want to exploit, both are shown in the attached file.

Place a single Title Block on an empty page.  Thus, it should be shape whose reference is sheet.1.

For your specific request, you may do the following:
1.)  Select the main title block shape (highest level)
2.)  Assign shape data properties to it.  For example:  Drawing Name, Drawing Number.  Make sure to click "Ask on drop"
3.)  Now select each corresponding text block and then go to menu bar > Insert > Field > Custom Formula.
4.)  In the box, type in something like:  sheet.1!prop.DwnBy.value.  You many not need the ".value", don't remember.  (That is, in my example, for the Drawn By text block, created the propertry, DwnBy.)

This will pull into each text box, the property value from the top level.  Save this title block to a custom stencil.  Now, when you drag and drop, it will ask for each property and place them in the correct field.

Note:  you can use the field insert to automatically insert standard text info without having to make it a Shape data property.  That's the 2nd shape.  There are a wide range of pre-defined entries that you may find to satisfy your needs without having to do Shape Data properties.

I did not do all of the fields in the title block, just 3 as way of example.
HTH

Wapperdude
Visio 2019 Pro

perry59

#2
Thanks for the help wapper.
I'm afraid I did run into some difficulties with your solution, I'm assuming because we have an old (2003) version of visio. I should have stated that initially.
So, right off the bat I could not assign "shape data" to a shape and so could not complete the exercise as you described. Also, when I put your shape into a stencil and then drug it into an empty drawing, it did not ask to fill in the data. In fact, I could not access its properties at all until I "ungrouped" it.
However, there is a gold nugget in your post that will be very helpful. When you said "In the box, type in something like:  sheet.1!prop.DwnBy.value" That let me know that I could define several bits of text in a shape and insert a field into each that can "call out to" a property in another shape rather that whats bound to the individual text. The only problem with that approach is that when I group these elements, right clicking the group no longer gives the custom properties contained within. There must be a way around that, I'll keep looking.
By the way, when you said that "it should be a shape whose reference is sheet.1", I assume any shape you create/place into sheet.1 will then reference that sheet? How does one determine a shapes reference? If the sheet name changes, the reference updates?

thanks
what, me worry?

wapperdude

My apologies for significant number of assumptions.  I was on lunch break at work and had to work quickly.

First, Visio2003 should be OK.  There might be some picky details, but nothing major.

So, let's see...

To begin, I would open the Drawing Explorer Window (DEW).  It's under View on the menu bar.  This will allow you to explore drawing pages, and shapes on a page -- tree view style.

When you plunk a shape down on a page, Visio numbers them is order of plunking.  So, the 1st shape, whether it's a single shape, or grouped, gets named sheet.1.  As you expand the tree in DEW, you can see what shapes are on a page.  Select a shape in the DEW and it gets selected in the drawing page.

You need these references when building your "calls" to various shapes.  Sometimes, it's unclear what the shape reference is.  You can select the shape in question, then go to Format > Special and the pop-up form will give specific details.  Your formula references will be specific to the page your working on.  If you copy the shape, references update.  IF you save to stencil, references update.

As far as adding Shape Data in V2003, it's basically same as V2007.  Some names may be different.  Select the shape, right click to get the context menu, should see an entry called something like Data > Shape Data.  Click on that, select new, and a form pops up.  I think the Visio help is pretty good on this.  You might want to check this out:  http://support.microsoft.com/kb/254730.

Once you define the properties for the parent shape, you can use the DEW to navigate to specific shapes within the group without doing the the multiple click thing.  Now you do the insert field routine, and all should be well.

Have fun exploring!

Wapperdude




Visio 2019 Pro

perry59

Well, I've made significant progress :)
My title blocks are working pretty much the way I want with minor exceptions.
At first, I thought I could not edit text that was part of a group, but thats not the case. Double-clicking the text will not put it in "edit mode" but I found that if I simply select it and begin typing it does enter "edit mode", then I can insert a field. I did find through some frustrating trial and error that if I put a bunch of text into a group I would get a "bad formula" error when trying to insert fields. However, if I put some other shape into the group it would work, so I just replaced one of the text entities with a rectangle that had text in it and everything is hunky dory.
Yes, the DEW and Format > Special are helpful indeed!
As far as "shape data" goes, when I right click on a shape, there is no DATA entry anywhere in the context menu. There is however shape->custom properties, is that the same thing?
As I said, my title blocks are the way I'd like them, but it would be nicer if it were easier to edit the properties. It would be nice if I could just double-click on the group and have the custom properties dialog pop up. Rather than right-clicking and navigating to shape->custom properties. Is there a way to do this? I know that through shape->behaviour you can change the default event for double click, but unfortunately there is not a choice for invoking the custom properties dialog. You can assign a macro though. Anyone know of a macro that will pop up the properties dialog for the selected shape?
Thanks for all your help!
what, me worry?

perry59

Oh yeah, one other thing. To the extent that I may have to use VBA to access the custom properties dialog box (or my own custom one), I thought it would be better if the groups I want to work with had the same or similar names. I  found that if I went to Format > Special I could change the name to something a bit more friendly, like "title block". Once I did that though, the formulas I tried to insert into fields bombed on me. Im sure my syntax was right, it was just like before except "sheet.1" would now be "titleblock". The shapesheet also said the name of the shape was "titleblock". So whats going on here?
Thanks
what, me worry?

wapperdude

Let's see...

Yes, "custom properties" is the old name.  That's what you want to push into.

Yes, you can get the desired double click behavior.  Open the shapesheet, scroll down to the Events Section, then, in the Eventdblclick box, enter DOCMD(1312).  For more info on the docmd, see:  http://msdn.microsoft.com/en-us/library/aa342178.aspx

After you changed the name, let's say, it's MyShape, did your formulas try to reference MyShape!something?  If your formulas were already inplace prior to name, Visio should have updated them.  If you're making new formulas, they ought to work with the new reference, although, sometimes not.  There are times you just have to revert to the basic sheet.###.

Wapperdude
Visio 2019 Pro

perry59

You Da Man!
They're working really nice now :)
After you changed the name, let's say, it's MyShape, did your formulas try to reference MyShape!something?
I really dont know. In the shapesheet I dont see any formulas related to fields in text. The only place I've seen those formulas is where I hand-typed them in to the "insert field" dialog box. I assumed they would break (my bad) and tried to insert new formulas. I just renamed the group again and left it alone and it seems to work fine (and the shapesheet shows the new name). So I guess the formulas DID pick up the new reference. Kinda moot now though that you've shown me how to do what I wanted without any coding. But perhaps it would be a good thing to give these specific objects names?
Anyway thanks a bunch for your help wapper, they're working sweet now!!!
what, me worry?

wapperdude

With the shapesheet open, right click in it's window and you can select between value and formula modes.

Visio 2019 Pro

perry59

Quote from: wapperdude on November 05, 2010, 10:57:22 PM
With the shapesheet open, right click in it's window and you can select between value and formula modes.

its already set to "formulas" but I only see what the forumula would evaluate to, not the field from which it came
what, me worry?

wapperdude

This link might be helpful, it's about the shapesheet.  http://msdn.microsoft.com/en-us/library/ms427031.aspx  Not much different V2003 and V2007.

Wapperdude
Visio 2019 Pro