Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Importing VisioStencils with pre-defined Connection Points (Read 1922 times)
Cyrinael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
Importing VisioStencils with pre-defined Connection Points
Jul 22nd, 2016 at 7:53am
Print Post  
Hello @all,

I currently work on a WPF Application which imports VisioShapes (*.vsx) using the VisioStencil-Class.
Although I can extract UserValues, Controls and more stuff from the Vsx.Shape-Class, I cannot find the actual pre-defined connection points.

Is there a way to extract them and create an AnchorPattern for the extracted Shape.

Thank you,

Cyrinael
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Importing VisioStencils with pre-defined Connection Points
Reply #1 - Jul 22nd, 2016 at 9:01am
Print Post  
Hi,

The Vsx.dll does not parse Shape/Connection elements at this time. Our developer will try to implement that next week.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Cyrinael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 22nd, 2016
Re: Importing VisioStencils with pre-defined Connection Points
Reply #2 - Jul 22nd, 2016 at 9:50am
Print Post  
Hi Slavcho,

thank you for your fast reply.
I am looking forward to try out the new implementation.

Have a nice weekend and thank you,

Cyrinael
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Importing VisioStencils with pre-defined Connection Points
Reply #3 - Jul 27th, 2016 at 12:28pm
Print Post  
Hi,

This build adds a Connection class to the vsx.dll library, which represents Shape/Connection elements from the stencil file -
https://mindfusion.eu/_beta/vsx_connections.zip

Now you could create corresponding AnchorPattern objects like this -

Code
Select All
var stencil = VisioStencil.LoadFromXml("basic_shapes.xml");
var master = stencil.Masters.Where(
	m => m.UniversalName == "Right triangle").FirstOrDefault();
var shape = master.Shapes[0];

// make shape formulas evaluate with 100x100 size
// mapping coordinates to percents required by AnchorPoint
shape.Width = shape.Height = 100;

var ptrn = new AnchorPattern();
foreach (var connection in shape.Connections)
{
	ptrn.Points.Add(
		new AnchorPoint(
			Convert.ToDouble(connection.X),
			Convert.ToDouble(connection.Y)));
} 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint