Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Node Anchor Limiting Link Creatiion (Read 2408 times)
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Node Anchor Limiting Link Creatiion
Jul 20th, 2017 at 11:26am
Print Post  
Hi,
    I am using a node for link creation i have specified the anchor for nodes so i can only connect to these anchor point. How can i restrict each anchor to be just a origin or destination at a time.Like if this anchor point is already used as an origin then it cannot be used as origin or as destination for same node. Also if this anchor point is already used as an destination then it cannot be used as origin or as destination for same node.

This is the code i am using for specifying anchor:
      private void diagram_NodeCreated(object sender, NodeEventArgs e)
        {

            DiagramNode Nd = e.Node;
            Color defAnch = Color.Black;
            Nd.AnchorPattern = new AnchorPattern(new AnchorPoint[]
                        {
                           new AnchorPoint(90, 50, true, true, MarkStyle.Rectangle, defAnch),
                            new AnchorPoint(10, 50, true, true, MarkStyle.Rectangle, defAnch),
                        });
        }

Now we are trying to restrict link creation at particular anchors described above using event diagram_LinkCreating.
Can you please suggest how I can do this
Thanks
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: Node Anchor Limiting Link Creatiion
Reply #1 - Jul 20th, 2017 at 1:17pm
Print Post  
Hi,

Try handling ValidateAnchorPoint event -
https://mindfusion.eu/Forum/YaBB.pl?num=1241592409/3#3

Regards,
Slavcho
  
Back to top
 
IP Logged
 
ashar11
Junior Member
**
Offline


I Love MindFusion!

Posts: 56
Joined: Jun 29th, 2017
Re: Node Anchor Limiting Link Creatiion
Reply #2 - Jul 20th, 2017 at 2:00pm
Print Post  
Actually what i wanted was that an anchor point cannot be connect if once it has been used ,even not for the third new node, but i already have write the code for that condition , So by using your code my scenario is completed.
Thank you very much Slavcho.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint