Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Decision Anchor Points (Read 773 times)
Benji
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: May 23rd, 2019
Decision Anchor Points
May 23rd, 2019 at 12:06pm
Print Post  
I'm trying to create a flow diagram with a decision shape.
No matter how much I've tried, I failed to set the anchor point for the decision shape. I always get A (in the attached image), while B is the desired output.

Following is the code snippet I use:
var diagram = new Diagram();

ShapeNode n1 = diagram.Factory.CreateShapeNode(10, 10, 24, 14);
ShapeNode n2 = diagram.Factory.CreateShapeNode(10, 10, 24, 14);
ShapeNode n3 = diagram.Factory.CreateShapeNode(10, 10, 24, 14);
ShapeNode n4 = diagram.Factory.CreateShapeNode(10, 10, 24, 14);
ShapeNode n5 = diagram.Factory.CreateShapeNode(10, 10, 24, 14);

n2.Shape.AnchorPattern = AnchorPattern.Decision1In3Out;
n2.Shape = Shapes.Decision;
n1.Shape = Shapes.Ellipse;
n5.Shape = Shapes.Ellipse;

n1.Text = "Start";
n2.Text = "Hungry";
n3.Text = "Eat";
n4.Text = "Sleep";
n5.Text = "End";

n1.ResizeToFitText(FitSize.KeepRatio);
n2.ResizeToFitText(FitSize.KeepRatio);
n3.ResizeToFitText(FitSize.KeepRatio);
n4.ResizeToFitText(FitSize.KeepRatio);
n5.ResizeToFitText(FitSize.KeepRatio);

var l1 = diagram.Factory.CreateDiagramLink(n1, n2);
var l2 = diagram.Factory.CreateDiagramLink(n2, n3);
var l3 = diagram.Factory.CreateDiagramLink(n2, n4);
var l4 = diagram.Factory.CreateDiagramLink(n3, n4);
var l5 = diagram.Factory.CreateDiagramLink(n4, n5);


l2.Text = "Yes";
l3.Text = "No";

l3.OriginAnchor = 3;
l3.AutoRoute = true;

var layout = new FlowchartLayout();
layout.Anchoring = Anchoring.Keep;
layout.Arrange(diagram);

var visioExporter = new VisioExporter();
visioExporter.Export(diagram, "test.vdx");
  

2019-05-23_14-51-41.jpg ( 30 KB | 17 Downloads )
2019-05-23_14-51-41.jpg
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 2033
Joined: Oct 19th, 2005
Re: Decision Anchor Points
Reply #1 - May 23rd, 2019 at 2:07pm
Print Post  
Try setting VisioExporter.DynamicsOff.

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