Modifying masters in a stencil

VISIO

    Sponsored Links

    Next

  • 1. What is Visio for?
    If you don't mind can you ask me? What is Visio for?
  • 2. get shapes inside a group by layer
    Hi i have to shapes A and B. A accepts shapes that are dropped on it and B is added to group when dropped. So now if i drop B on A, B is in the group. A is member of layer 'LA' and B is member of 'LB' is it possible to select all members of LB? The thing i am doing at the moment, is diging through the A.shapes, to get all the B shapes inside A.
  • 3. Can I create a Visio doc with my own code?
    I am trying to figure out a way to create or modify a Visio doc from outside of Visio. For example, I'm doing SNMP queries on a FreeBSD box using Perl and as I gather information from network devices I would like to update my Visio drawings that reside on WinXP, Win2003, and/or Win2000 boxes. The programming or scripting language isn a probleme can use just about anything that necessary, although a portable language or script would be great. Thanks, Chuck Coker ---------------------------------------------------------------- Chuck Coker chuck.coker (et) rcc (dit) edu Riverside Community College, Information Services 4800 Magnolia Avenue, Riverside, California 92506, United States +1 951 222 8759 (desk) +1 951 830 8068 (cell) ----------------------------------------------------------------
  • 4. Connection Point event, dynamic vs. static
    Hello, I am capturing connection add events. The FromSheet always includes the connector shape. If I use a dynamic connection point in my drawing (holding down ctrl while connecting to a shape in my diagram), the ToSheet is populated. If I use a static connection point (not holding down ctrl while connecting) the ToSheet contains 0 shapes. What's up? Here's the code. I simplified the get_Cells statement to simplify the example. My real concern is that ToSheet.Shapes.Count = 0. *********************** case ((short) -32768 + (short) Visio.VisEventCodes.visEvtConnect): connectionPoint = (Visio.Connects) subject; string test1 = connectionPoint.FromSheet.get_Cells("BeginX").Formula ; string test2 = connectionPoint.ToSheet.get_Cells("BeginX").Formula ; (short)Visio.VisCellIndices.visCustPropsValue).Formula ; System.Windows.Forms.MessageBox.Show("add from " + test1 + " to " + test2); break; *********************

Modifying masters in a stencil

Postby Markus Breugst » Sat, 08 Jan 2005 23:06:47 GMT

Dear All,

I would like to programatically modify a stencil by changing the name and
some properties of the contained master shapes. (The name I want to change
is the name that is displayed below each master in the stencil.)
This is to be implemented in a C# application. However, for testing I wrote
the VBA macro below.

The macro works fine if the stencil is open for editing (mouse click onto
the top left corner of the stencil, then click "Edit").

Question: How can I enter a stencil's edit mode programatically? I tried
this via the AllowEditing flag or by closing and re-opening the stencil with
the 'visOpenRW' flag. Unfortunately, both did not work. I found several
newsgroup threads concerning this issue, but none of them really helped me.

Thanks a lot in advance for any hint!

Best regards,
Markus


Public Sub UpdateStencil()
    Dim myStencil As Document
    Dim myMasters As Masters
    Dim myMaster As Master
    Dim myMasterCopy As Master
    Dim myShape As Shape
    Dim index As Integer
    Dim win As Window

    On Error Resume Next

    Set myStencil = Documents("My Stencil.vss")
    myStencil.Title = "New Title"
    Set myMasters = myStencil.Masters
    For index = 1 To myMasters.Count
        Set myMaster = myMasters(index)
        Set myMasterCopy = myMasters(index).Open
        Set myShape = myMasterCopy.Shapes(1)
        myMaster.Name = "New Name"
        myShape.Cells("User.ELEMENT_ID").Formula = 12345
        myMasterCopy.Close
    Next index
    myStencil.Save
End Sub




Similar Threads:

1.Visio 2003 - Org Chart from Excel Ignores Modified Masters in Document Stencil

2.Modify selection of masters in stencil?

Hi!
I have a C# application hosting a Visio ActiveX control. The
application enables the user to create new masters (programatically).
However, when a new master is created (using Stencil.Drop()), it gets
selected, in addition to the already selected masters.
I know I can get the currently selected masters list from the windows
of the stencil, but is there a way to modify this selection?

Thanks,
Gil

3.Modify a shape master and update all the shapes on the visio p

4.Modify a shape master and update all the shapes on the visio pages

Hi,
my problem is the following:
1) I create a new shape master
2) I use it many times in a one or more visio pages
3) then when I make a modification on the shape master I would automatically 
update all the shapes on the visio pages I used before; is that possibile? 
how?
Please, help me!

5.DoDragDrop on modified master shapes has strange side-effect

The scenario is the following:

I have a tree which I drag shapes from. When dragging the item, i find its 
corresponding master in the document stencil (via doc.Masters.get_ItemU) and 
DoDragDrop(foundMaster, DragDropEffects.Copy) on the master shape I get.

After doing this a couple of times (and it works as it should) i edit (in 
visio) the master shape in the document stencil. After updating all 
references i try dragging another one in from my tree. The dragged object 
looks fine, but when releasing/dropping the shape on the drawing surface, the 
text is renamed to what it was before, and another master is created in the 
document stencil.

Why is this happening? My code find the correct master since the text is 
correct when dragging the item without releasing it... But Visio does 
something when i release it. I know that the UniqueID changes when editing 
the text, but should this really be a problem?

If i edit the master in the document stencil before doing any drag-and-drop 
operation, then drag-and-drop works (no change of text and no new master 
shape), but immediately after editing the master, it starts acting weird!

Dragging the master from the document stencil works fine in every case.


Another thing:
I have also noticed that the icon when my drag-and-drop operation is going 
on, is more like in windows explorer, but when using the document stencil 
it's only a small 'plus' sign. What is the difference?.. How can I access 
Visios internal drag-and-drop functionality?


6. Modified Shape Masters have funny effect on Text Placement

7. master shape in stencil versus document stencil

8. How to update document stencil master from stencil



Return to VISIO

 

Who is online

Users browsing this forum: No registered users and 83 guest