Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Get the area bounds based on node id (Read 3129 times)
Shah
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Jan 4th, 2016
Get the area bounds based on node id
Feb 23rd, 2016 at 10:44am
Print Post  
Hi,

Is it possible to get node bounds based on specified node id? Is there any vb.net sample i can refer?

Thanks.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Get the area bounds based on node id
Reply #1 - Feb 23rd, 2016 at 10:47am
Print Post  
Hi,

If you have assigned an identifier to DiagramNode.Id property, you can find the node by calling Diagram.FindNodeById() method. The node's boundaries are returned by DiagramNode.Bounds property.

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


I Love MindFusion!

Posts: 21
Joined: Jan 4th, 2016
Re: Get the area bounds based on node id
Reply #2 - Feb 23rd, 2016 at 10:49am
Print Post  
Hi,

Any sample code i can refer to?

Thanks.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Get the area bounds based on node id
Reply #3 - Feb 23rd, 2016 at 11:27am
Print Post  
Hi,

Here's a code snippet that returns optional RectangleF value if the specified node exists -

Code
Select All
Function NodeBoundsFromId(ByVal id As Object) As RectangleF?
	Dim node As DiagramNode = Diagram1.FindNodeById(id)
	If node Is Nothing Then Return Nothing
	Return node.Bounds
End Function

Diagram1.Factory.CreateShapeNode(10, 10, 10, 10).Id = "1"
Dim r As RectangleF? = NodeBoundsFromId("1")
If r IsNot Nothing Then Debug.WriteLine(r) 



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


I Love MindFusion!

Posts: 21
Joined: Jan 4th, 2016
Re: Get the area bounds based on node id
Reply #4 - Feb 23rd, 2016 at 11:49am
Print Post  
Hi,

Thanks for the sample. It's work.

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