Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can diagrams merge into a new diagram in Netdiagra (Read 1948 times)
chieh
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 64
Joined: Aug 18th, 2010
Can diagrams merge into a new diagram in Netdiagra
Oct 26th, 2011 at 1:56pm
Print Post  
Dear Sir/Madam,
Currently we are using NetDiagram 4 (Java Applet mode) and environment is ASP.NET 2.0/window server 2003/IIS6.0
Can I ask how to achieve the scenario below?
User has created two diagrams, and each diagram contains nodes and links which are between nodes, it that possible to merge/join two or more diagrams in a new diagram (DiagramView) programmatically?
Nodes or links’ name are unique between diagrams.
For an example,
DiagramView1 contains node1, node2 and a link1 connected node1 and node2.
DiagramView2 contains node3, node4 and a link2 connected node3 and node4.
How to copy all shapes in diagram1 and diagram2 to a new DiagramView3?
So diagram3 will have node1, node2, node3, node4, link1 and link2
Many thanks for any solution
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Can diagrams merge into a new diagram in Netdi
Reply #1 - Oct 26th, 2011 at 3:14pm
Print Post  
Try this method:

Code
Select All
void MergeDiagrams(Diagram src1, Diagram src2, Diagram dest)
{
	dest.ClearAll();

	SelectAll(src1);
	dest.PasteSelection(dest, src1.CopySelection(src1, false, false), null, 0, 0);

	SelectAll(src2);
	dest.PasteSelection(dest, src2.CopySelection(src2, false, false), null, 0, 0);

	src1.Selection.Clear();
	src2.Selection.Clear();
}

void SelectAll(Diagram diagram)
{
	foreach (DiagramItem item in diagram.Items)
		diagram.Selection.AddItem(item);
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
chieh
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 64
Joined: Aug 18th, 2010
Re: Can diagrams merge into a new diagram in Netdi
Reply #2 - Oct 26th, 2011 at 4:27pm
Print Post  
Hi Stoyan,

it works

Thanks a lot


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