This project has moved and is read-only. For the latest updates, please go here.

Connecting shapes with line segments (circuit diagram style)

Sep 29, 2014 at 8:53 AM
What is the preferred (or proposed) way to create connection between shapes similar to connection between electronic components?

I would like to create something similar to http://upload.wikimedia.org/wikipedia/commons/7/76/4_bit_counter.svg, where VCC line is distibuted to multiple shapes and black dots have function of "junction".

What approach would you suggest?


Thank you,
Zvonko
Sep 30, 2014 at 8:58 AM
You can add connection points (that are not vertices) to linear shapes by calling ILinearShape.AddConnectionPoint(). These connection points maintain their position relative to the next and the previous vertex point.
This functionality is also available via context menu.

For the black dots you can use line caps ("CenteredCircle").
For the electric symbols, you can use
  • aggregated shapes,
  • EMF images exported from aggregated shapes (select the shapes that should be on the picture and select "Export Diagram as Image > Custom..." from the NShapeDesigner's main menu)
  • custom shapes derived from the standard shapes (best performance).
See also "Programmer Tasks > Customizing the Toolbox > Loading a Template Project" in the documentation and the project file "Demo Programs\Security Demo\Sample Project\Security Demo Sample Project.nspj" which uses aggregated shapes as electrical symbols.