Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Merging diagrams (Read 2148 times)
Iain
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Mar 16th, 2018
Merging diagrams
Mar 16th, 2018 at 4:02pm
Print Post  
Hi

This is my first question on this forum so bear with me!

I want to merge two diagrams in FlowChart.NET. So I start with one diagram, and I want to load new nodes and links for that diagram from a file, but without losing the existing nodes. Is this possible with LoadFromXML or something like that? Is it possible to put the new nodes in their own group?

I guess you could do this by writing a lot of custom code, but is there an easier way?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: Merging diagrams
Reply #1 - Mar 16th, 2018 at 4:11pm
Print Post  
Hi,

There's no built-in merge method, but shouldn't be that hard to implement using the CopySelection and PasteSeleciton methods. E.g. create an off-screen Diagram instance, call its LoadFromXml method, select all items, then CopySelection from it and PasteSelection into the main diagram.

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


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: Merging diagrams
Reply #2 - Mar 19th, 2018 at 6:40am
Print Post  
e.g. try this method -

Code
Select All
void InsertFromXml(string fileName)
{
	var temp = new Diagram();
	temp.LoadFromXml(fileName);
	foreach (var item in temp.Items)
		item.Selected = true;
	var copy = temp.CopySelection(temp, true, true);
	diagram.PasteSelection(diagram, copy, null, 0, 0);
} 



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