Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Map shape text to custom property?

7 views
Skip to first unread message

HLM

unread,
Oct 24, 2004, 11:22:29 AM10/24/04
to

Any quick answers? also want to link this to a database field. I have the
link for a custom property working like a champ, but I want the default text
property to reflect the value in a custom property.

help?


HLM

unread,
Oct 24, 2004, 3:14:08 PM10/24/04
to
Aahh, just had to make sure the custom property used for the KEY in the
database was empty and then make the value for the property I wanted to save
the shape text in:
=SHAPETEXT(theText)

Saved the master shape and now when I drag it over to my drawing I am
prompted for a KEY value and then when I double click the shape I type the
text and the custom property updates as I type. waaay cool....

If any of this drivvle inerests anyone just post a reply, I'll give more
details.

Huey


"HLM" <H...@no-email.com> wrote in message
news:uuPaI1du...@TK2MSFTNGP12.phx.gbl...

Maxarian

unread,
Oct 25, 2004, 3:17:03 AM10/25/04
to
Please explain in detail?

HLM

unread,
Oct 25, 2004, 2:44:38 PM10/25/04
to
LOL - ok, I will since I see there's someone that would read it and maybe
comment on my solution.

What I've done, in Visio Pro 2003, is copied a server shape from the rack
stencil into my own stencil so I can modify it. I then placed the server
shape on a drawing, added a couple custom properties to the shape such as
"ServerName", and ran the database wizard to connect this shape to an access
database. I had to create the ODBC DSN and the access database via this
wizard. Once I completed the wizard I opened the shapesheet for the shape
and modified the value for the custom property I wanted to "tie" to the
shape's text to be "=GUARD(SHAPETEXT(TheText))" (minus the quotes.) and
then I made sure the custom property I assigned to be the index or KEY in
the database had no value.

I then dragged the shape back to the stencil and saved it as a new master.
Now, when I drag this shape onto a drawing, I am prompted to enter a value
for the index property (the KEY field in the database). After I enter the
value the shape is dropped on the drawing. When I double-click the shape I
get the textbox edit field and the custom property page pops open. As I
type the text into the shapes textbox I can see the custom property I "tied"
it to update as I type. Since I used the "GUARD" function in the value on
the shapesheet the shape is not allowed to change this value to anything
else. It is forced to be the value of the shapes text no matter. However,
once the shape is synched to the database, the actual value is stored in
this property rather than the formula.

Why did I do this? I wanted to be able to place a new server in a rack,
have it automatically tied to my server database and have it's name
displayed as the default shape text on my drawing. This is only good for
placing a new shape on the drawing too since once the shape is synched with
the database the value for this property will be the real value, rather than
the initial formula.

I haven't worked out the details yet, but I think I'll have one shape for
adding a brand new server to my drawing which is tied in this way so I can
more easily add the server's name to a new shape and database record. Then
create a copy of the shape for adding a server to the drawing that already
has an entry in my server database. This copy would be configured to grab
the server name from the database and update the shape's text with this
value as it is dropped onto the drawing.

Really just did this as a learning experience as I embark on building a
"smart" visio drawing of all our rack elevation diagrams which is tied to a
server configuration database. Hopefully, I can have a floor plan of our
server room, click on a particular rack and have that rack's elevation
diagram open up. Then one step further, a click on a particular server will
bring up all it's pertinent information for review and or modification.

Ok, now that I've typed this all out can someone tell me the "two-click"
method to do all this :]

Huey

"Maxarian" <Maxa...@discussions.microsoft.com> wrote in message
news:45E98902-C697-435F...@microsoft.com...

Mark Nelson [MS]

unread,
Oct 26, 2004, 1:46:25 AM10/26/04
to
If I understand correctly, you want a shape that can push its text to a
custom property when it is created, but then you want the custom property to
drive the text from there on out. If you want to go both ways, I believe
you'll need to write code to keep things in sync.

If you want the custom property to always refer to shape text, you already
figured out the formula to put in the custom property cell. If you want the
shape text to always refer to the custom property, go to Insert > Field to
set up that relationship.

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

"HLM" <H...@no-email.com> wrote in message

news:eqj4vKsu...@TK2MSFTNGP12.phx.gbl...

Patterson@discussions.microsoft.com Richard Patterson

unread,
Feb 3, 2005, 11:35:07 AM2/3/05
to
Can this technique be used for an existing floor plan drawing? I have a
floor plan that was drawn with a CAD. I would like to link the rooms in the
drawing to information that I have in a database.

Mark Nelson [MS]

unread,
Feb 5, 2005, 1:01:10 AM2/5/05
to
Using the Space Plan template and shapes, you can create a floor plan linked
to a database. Generally you use the CAD drawing as a background image and
drop Space shapes on top for each room. The Space shapes can be linked to
data using the Import Data Wizard. Go to Tools > Addons > Run Addon to find
the Import Data Wizard.

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

"Richard Patterson" <Richard Patt...@discussions.microsoft.com> wrote in
message news:5719F304-E978-43AD...@microsoft.com...

0 new messages