We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

essential diagram (snap and glue)

Thread ID:

Created:

Updated:

Platform:

Replies:

70766 Dec 29,2007 01:21 AM Apr 19,2010 07:57 PM Windows Forms 6
loading
Tags: Diagram
Roger Hawkins
Asked On December 29, 2007 01:21 AM

Do you have a snap and glue facility like provided in visio?
How would I achieve the same functionality with your product e.g. I would like to drag a shape from a pallet onto another shape on the design form and have it snap on to a particular edge of that shape and stay there within boundaries. And to be able to add more shapes of the same type to to this shape on the form in the same way.




Administrator [Syncfusion]
Replied On January 3, 2008 06:40 AM

Hi Rhawk,

Sorry for the delay in responding you.

Snap and Glue

Yes, the diagram entities (shapes, text nodes etc.,) can be grouped (or glued) together to act as a composite whole.

The nodes in the Essential diagram can be grouped and ungrouped by using the Group( ) and UnGroup( ) methods as shown in the code snippet below,

[C#]

// Group nodes
this.diagram1.Controller.Group();

// Ungroup nodes
this.diagram1.Controller.UnGroup();

Sample reference

Please refer the sample that shipped with Essential studio in the below location. This sample demonstrates how nodes in the Diagram Model can grouped together or ungrouped. You can also add more shapes of the same type.

[Install drive]:\Documents and Settings\UserName\My Documents\Syncfusion\EssentialStudio\version\Windows\Diagram.Windows\Samples\2.0\Quick Start\Serialization

Thank you for your interest in Syncfusion products.

Please let me know if you have any further questions.

Regards,
Jaya



Roger Hawkins
Replied On January 5, 2008 07:58 PM

hi I'm not sure I understand how this enables snap and glue.

The scenario is there is an object on the drawing area and I drag a different object from the pallet on to it. The new one snaps and glues to the bottom (for example) of the existing one and stays there if the object is moved around - this can be repeated and the new objects get attached (glued) next to the other ones on the bottom of the existing object. I can detatch by simply selecting one of the dragged objects and deleting it or cutting and pasting elsewhere.
does this make sense?
thx


Administrator [Syncfusion]
Replied On January 7, 2008 12:09 AM

Hi Rhawk,

Thanks for the update.

It is possible with Essential diagram to group the new diagram object to the bottom of existing diagram object. You can also detach them by ungrouping it.

Please refer the video file that demonstrates on grouping the new diagram object to the bottom of an existing diagram object.

http://websamples.syncfusion.com/samples/Diagram.Windows/F70766/Video/main.htm

You can also use SendToBack() method of the diagram model to send a node back to another. Below is the code snippet.

[C#]

this.diagram1.Model.SendToBack(dgmobject);

Please refer previous post for grouping and ungrouping the diagram entities programmatically.

Sample reference

Please refer the DiagramBuilder sample that shipped with Essential diagram in the below location that accomplishes the above said feature.

[Install drive]:\Documents and Settings\UserName\My Documents\Syncfusion\ EssentialStudio\x.x.x.xx\Windows\Diagram.Windows\Samples\2.0\In Depth\DiagramBuilder

Please let me know if this meets your requirement.

Regards,
Jaya


Roger Hawkins
Replied On January 8, 2008 12:44 AM

thanks for this,

the video doesnt show an object connecting to the bottom of another just grouped.

I understand that your API allows grouping of objects (thanks for the info) but this is different to snapping and gluing - e.g. the level of control available.

What I wanted to know was can I drag one object on to another and have it 'snap' to the bottom (or wherever I tell it) of this object. .e.g. like to visio snap and glue (as mentioned).

thx


Administrator [Syncfusion]
Replied On January 9, 2008 01:18 PM

Hi Rhawk,

Thanks for the update.

Visio like Snap and Glue

I regret to let you know currently we don't have support for snap one diagram object to another diagram object like in Visio. We have forwaded this to development team and will let you know once this feature is implemented.

Please let me know if you have any further questions.

Regards,
Jaya


Tony Hansen
Replied On April 19, 2010 07:57 PM

Has there been any progress with this?

I've been toying with the Diagram component, and for this component to be usable for us, we really need some "snapping" functionality.

Our use case: we currently load a scanned image of a shopping center site plan into the Diagram component as a background image. We then use the "polygon" tool to trace the shape of each individual store on the plan, thus producing a diagram of the entire floorplan in which each store can be selected as a node.

The issue is that drawing the lines for each store is very difficult because the polygon tool allows a little TOO much flexibility in how lines are drawn.

Here's what we need to get this to work:

1. The ability to hold down either the Shift, Ctrl or Alt keys, in order to ensure our line draws at either 0,45,90,135,180,225,270,315 or 360 degrees. That way we can get absolutely horizontal, vertical or 45 degree lines; and
2. "Vertex snapping" ... as we draw each side of the polygon and click the mouse button to set a vertex (corner) point, the control should detect whether or not we're clicking close to the vertex of another control, and if so, "snap" the click to that point. That way we can ensure that all of our vertexs overlap precisely.

What do you think? Is it possible to implement those functions? If so, what kind of timeframe would we be looking at? We have a fairly urgent requirement for a diagram component, and I'd really like to use the Syncfusion component, if those 2 requirements can be addressed...

Thanks!

Tony

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;