Nevron Forum

create dynamic connectors

https://www.nevron.com/Forum/Topic4589.aspx

By javier marquez - Monday, November 29, 2010

I am using Nevron Diagram to create a diagram with data stored in my database to create objects of type NShape performed with for what follows

Dim read As SqlDataReader = consultadatosDB (consultaobjetivos)
            
Do While lectura.Read ()
                

                Nombre_objetos Dim As NShape = CreateFlowChartingShape (Documento_diagrama, FlowChartingShapes.Decision, GetGridCell (lectura.Item (4), lectura.Item (5)), lectura.Item (1), "CPA")

               
               Loop

This works fine, but when I create the connectors I have a problem, because only I have the name of a NShape, I wonder how I can create dynamic way connectors with different names to create their connectors,

CreateConnector (Documento_diagrama, nombre_objetos, "Center", nombre_objetos, "Center", ConnectorType.Line, "NO")
 
Thank you very much.
JAMV

By Nevron Support - Tuesday, November 30, 2010

Hello Javier,

Can you please elaborate and explain more clearly what you are trying to achieve.

By javier marquez - Wednesday, December 1, 2010

thanks
 
The idea is this, I create a chart dynamically, as follows

users enter data about each of its processes and the sequence in which they like the level and sublevel of each process, the idea is that with that information stored in database diagram can be generated


consultadatosDB: is a class that I see the number and a description of the objects must be created in the diagram, it also brings the values of their position


Dim read As SqlDataReader = consultadatosDB (consultaobjetivos)
            
Do While lectura.Read ()
               
                 
Name_objetos Dim As NShape = CreateFlowChartingShape (Documento_diagrama, FlowChartingShapes.Decision, GetGridCell (lectura.Item (4), lectura.Item (5)), lectura.Item (1), "DESIGN")

                              
Loop

lectura.item (4) = vertical position
lectura.item (4) = horizontal position
lectura.item (1) = object name

This works great, now I want to create the connectors between objects

and carried out as follows


CreateConnector (Documento_diagrama, name_objetos, "Center", name_objetos, "Center", ConnectorType.Line, "NO")

The problem here is him / herself that CreateConnector dees for the name of NShape type objects to create the connector, but as my connections are all are created dynamically with the same name Dim As name_objetos NShape and display connectors each pointing to himself I would like to know if you can help me solve this problem

 

thanks

By Nevron Support - Wednesday, December 15, 2010

Hello Javier,
We are unable to understand the problems you currently experience.
Can you please send us your sample project. Also, please explain more clearly what is the problem with the connectors names.

By javier marquez - Saturday, December 18, 2010

I think the problem is simple, I want to create dynamic NShape and want to create the connectors of these NShape capturing information database

Thank you....
By Nevron Support - Monday, December 20, 2010

Hello Javier,

The following is a simple example on how to create a diagram from a database using the automatic Graph Data Importer: http://support.nevron.com/KB/a27/automatically-create-a-diagram-from-a-database.aspx

Note – to set the connectors texts, you can subscribe to the EdgeImported event of the Data Importer (similar to the VertexImported event like in the example).