Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Visio "Custom Properties" for Flow Chart (Read 6044 times)
JCRonSaratoga
YaBB Newbies
*
Offline


Go Cubs Go!

Posts: 30
Joined: Apr 15th, 2008
Visio "Custom Properties" for Flow Chart
Apr 16th, 2008 at 3:16pm
Print Post  
Hi

Using the MindFusion components, is it possible to access the "Custom Properties" information for a Visio Flow Chart shape?  I have a simple flow chart, with a custom property label called "Shape#" for the first flow chart element it has a value of "1", for the second flow chart element it has a value of "2", etc.  I want to display the visio flow chart (via the Visio .vdx file) then change the color of the Shapes.

If this is not possible, do you have any suggestions as to how I can dynamically change the Visio Flow Chart shapes.

Thanks
Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Visio "Custom Properties" for Flow C
Reply #1 - Apr 16th, 2008 at 3:34pm
Print Post  
If that will help, we can add an XmlElement argument to the NodeImported event - you could use it to find the XML DOM elements for the custom properties, and any other information related to the shape that is not imported automatically.

Stoyan
  
Back to top
 
IP Logged
 
JCRonSaratoga
YaBB Newbies
*
Offline


Go Cubs Go!

Posts: 30
Joined: Apr 15th, 2008
Re: Visio "Custom Properties" for Flow C
Reply #2 - Apr 16th, 2008 at 3:39pm
Print Post  
Whoa!  That would be sweet! 

If I understand you correct, that is.  I see in Visio I can add "Custom Properties" and given them values.  Is what you are saying that I can then access those?  If so SWEET!!  Then when do you see being able to do this?

Thanks
Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Visio "Custom Properties" for Flow C
Reply #3 - Apr 16th, 2008 at 3:54pm
Print Post  
8) We'll try to add it for the version 5.1 release - we'll start beta tests for it in about a week.

Stoyan
  
Back to top
 
IP Logged
 
JCRonSaratoga
YaBB Newbies
*
Offline


Go Cubs Go!

Posts: 30
Joined: Apr 15th, 2008
Re: Visio "Custom Properties" for Flow C
Reply #4 - Apr 16th, 2008 at 3:57pm
Print Post  
That would be sweet!

Can I get access to the beta?

Thanks
Jim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Visio "Custom Properties" for Flow C
Reply #5 - Apr 17th, 2008 at 7:20am
Print Post  
Yes, I'll post the download link here when the beta is available.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Visio "Custom Properties" for Flow C
Reply #6 - Apr 18th, 2008 at 8:33am
Print Post  
This version of the VisioImporter adds a ShapeXml argument to the ShapeImported event:
https://mindfusion.eu/_beta/fcnet51_visioxml.zip

Assuming you have added a custom property called "MyProperty", you can get its value like this:

Code
Select All
private void ShapeImported(object sender, ShapeImportedEventArgs e)
{
	XmlNode vdxCode = e.ShapeXml;
	try
	{
		XmlNamespaceManager ns = new XmlNamespaceManager(e.ShapeXml.OwnerDocument.NameTable);
		ns.AddNamespace("vdx", "http://schemas.microsoft.com/visio/2003/core");

		XmlNode myPropVal = vdxCode.SelectSingleNode("vdx:Prop[vdx:Label='MyProperty']/vdx:Value", ns);
		if (myPropVal != null)
			e.Shape.Tag = myPropVal.InnerText;
	}
	catch (Exception ex)
	{
		MessageBox.Show(ex.Message);
	}
}
 



I don't know if all Visio shapes save the custom properties in that format. If that XPath doesn't work for you, look in the VDX file to see where exactly the property is saved for the shapes you are using.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
JCRonSaratoga
YaBB Newbies
*
Offline


Go Cubs Go!

Posts: 30
Joined: Apr 15th, 2008
Re: Visio "Custom Properties" for Flow C
Reply #7 - Apr 21st, 2008 at 4:59pm
Print Post  
Thank you for the coding,  I converted it to VB.Net 2008.   Can you please send me how to call that subroutine?  Here is what I have tried, but it is not working:

    Private Sub btnImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnImport.Click
       Dim ofd As New OpenFileDialog
       If ofd.ShowDialog() = DialogResult.OK Then
           Dim imp As New VisioImporter
           imp.ImportAllPages(ofd.FileName, diag)
           Dim AAA As MindFusion.Diagramming.Import.ShapeImportedEventArgs
           Call ShapeImported(sender, AAA)
       End If

    End Sub
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Visio "Custom Properties" for Flow C
Reply #8 - Apr 21st, 2008 at 5:25pm
Print Post  
That's a handler for the importer's ShapeImported event. In VB.NET, you should attach it like this -

AddHandler imp.ShapeImported, AddressOf ShapeImported

before calling the ImportAllPages method.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
JCRonSaratoga
YaBB Newbies
*
Offline


Go Cubs Go!

Posts: 30
Joined: Apr 15th, 2008
Re: Visio "Custom Properties" for Flow C
Reply #9 - Apr 21st, 2008 at 8:22pm
Print Post  
Excellent!  Thank you, that works well!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint