Define shape type for custom shapes in stencil file - Visio 2013

Started by MrSir, August 18, 2014, 11:24:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MrSir

Hello

Im developing custom Visio stencils/shapes and i would like to define the type for these shapes. I have looked under Properties, and the Property Sheet, but no luck.
I have also tried to use the "Shape name" function under Developer, this does not work either.

How do i define the type/name for a custom shape?

I need to be able to reference the shapes by name when using Visio through the COM interface. Microsoft.Office.Interop.Visio, like this:

Microsoft.Office.Interop.Visio.Master visioRectMaster = visioStencil.Masters.get_ItemU("Rectangle"); // <-- This Works, Rectangle is a build in type from "Basic shapes.vss"
Microsoft.Office.Interop.Visio.Shape visioRectShape = visioPage.Drop(visioRectMaster, 4.25, 5.5);

Microsoft.Office.Interop.Visio.Master visioRectMaster = visioStencil.Masters.get_ItemU("MyCustomShapeType"); // <-- This does not work!
Microsoft.Office.Interop.Visio.Shape visioRectShape = visioPage.Drop(visioRectMaster, 4.25, 5.5);


Regards MrSir

Paul Herber

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

MrSir

Hello Paul

I don't understand the question, i have developed the shapes in Visio.

Ragards MrSir

daihashi

on your document stencil pane, right click on the master that you'd like to rename and choose "rename master". Alternatively you could do it programmatically by doing something like, assuming your master's current name is "Master", and you wanted to change it to "NEWname".

Sub changename()
     ActiveDocument.Masters("Master").Name = "NEWname"
End Sub