Determining Shape Type

Y

ytw

Hi -

I'm new to visio. Please help.

Using the visio automation interface, is there an easy way to tell that a
shape is a Database Entity?

I figured maybe checking values in user-defined cells can yield such info,
but perhaps there's an easier way.

Thanks,
 
P

Paul Herber

Hi -

I'm new to visio. Please help.

Using the visio automation interface, is there an easy way to tell that a
shape is a Database Entity?

I figured maybe checking values in user-defined cells can yield such info,
but perhaps there's an easier way.

from the shape object, look at the property Master.Name
 
Y

ytw

Really appreciate your help.

I got "Entity.17" as the value of a shape's Master.Name property.
"Entity.18" for another shape in a different page.
What does the suffix (17, 18) mean?
Is there another property that will just return "Entity"?

Thanks,
 
P

Paul Herber

That's exactly what the Master.Name should do.
Have a look at the drawing document stencil
menu File -> Shapes -> Show Document Stencil
If there is a shape there called Entity.18 then, yes, it is the full
name of the master. Possibly the shape Entity is being created
dynamically, hence, updating the diagram is always creating a new
master. It may be that Entity .. Entity.17 are no longer used and can
be deleted.
Otherwise, a simple function will return just the part of the string
up to the '.'
 
Y

ytw

Thanks for the reply.

I played around with Visio some more and found that Master.Name can be
changed by the user. This is bad news for me since I can't use Master.Name
to reliably identify a Shape as being a Database Entity. Are there other
read-only properties that can be used to distinguish the various Shapes (e.g.
this shape is an entity, that's a relationship, etc)?
 
M

Mark Nelson [MS]

Master.NameU is the universal name and can only be set programmatically.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

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

ytw said:
Thanks for the reply.

I played around with Visio some more and found that Master.Name can be
changed by the user. This is bad news for me since I can't use
Master.Name
to reliably identify a Shape as being a Database Entity. Are there other
read-only properties that can be used to distinguish the various Shapes
(e.g.
this shape is an entity, that's a relationship, etc)?
 
Y

ytw

Hi -
Thanks.

When I change Master.Name in Drawing Explorer in Visio, Master.NameU seems
to change as well (I used VB to print out various properties). I'm back to
square one. I still don't know how to reliablely determine that a shape is a
database table. I'm trying to write a visio importer for an app so knowing
that a shape is table is very important.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top