Nevron Forum
Back
Login
Register
Login
Register
Home
»
Nevron Vision for NET
»
Nevron Diagram for .NET
»
Cloned shapes connections does not route correctly
Cloned shapes connections does not route correctly
Post Reply
Cloned
shape
s
connections
does
not
route
correctly
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
Goto Topics Forum
Author
Message
Niranjan Singh
Niranjan Singh
posted 6 Years Ago
ANSWER
Topic Details
Group: Forum Members
Posts: 49,
Visits: 179
Hi
Team
,
I
am
adding
shape
s
from
one
DrawingDocument
to
another
after
cloning
.
public
static
NDrawingDocument
CopyDigram
(
NDrawingDocument
nProjectDiagram
,
NDrawingDocument
nSystemTemplateDiagram
,
Dictionary
&
lt
;
string
,
string
&
gt
;
oldNewComponentIds
)
{
for
(
int
i
=
0
;
i
&
lt
;
nSystemTemplateDiagram
.
ActiveLayer
.
ChildrenCount
(
null
);
i
++)
&
nbsp
; {
&
nbsp
;&
nbsp
;
Hashtable
mapUids
=
new
Hashtable
();
&
nbsp
;&
nbsp
;
INNode
node
=
nSystemTemplateDiagram
.
ActiveLayer
.
GetChildAt
(
i
);
if
(
node
is
NComposite
Shape
)
&
nbsp
;&
nbsp
; {
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
N
Shape
soruceDiagram
Shape
= (
N
Shape
)
node
;
N
Shape
shape
=
soruceDiagram
Shape
.
CloneWithNewUniqueId
(
mapUids
)
as
N
Shape
;
shape
.
UniqueId
=
Guid
.
Parse
(
oldNewComponentIds
[
soruceDiagram
Shape
.
UniqueId
.
ToString
()]); //
Replace
guid
from
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
nProjectDiagram
.
ActiveLayer
.
AddChild
(
shape
);
}
else
if
(
node
is
NRoutableConnector
)
&
nbsp
;&
nbsp
; {
NRoutableConnector
sourceDiagramConnector
= (
NRoutableConnector
)
node
;
NRoutableConnector
connector
=
templateDiagramConnector
.
CloneWithNewUniqueId
(
mapUids
)
as
NRoutableConnector
;
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
connector
.
UniqueId
=
Guid
.
Parse
(
oldNewComponentIds
[
templateDiagramConnector
.
UniqueId
.
ToString
()]);
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;//
connector
.
RerouteAutomatically
=
RerouteAutomatically
.
Always
;
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;//
connector
.
Location
=
templateDiagramConnector
.
Location
;
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
nProjectDiagram
.
ActiveLayer
.
AddChild
(
connector
);
}
//
Iterate
all
connectors
from
source
diagram
and
find
corroessponding
shape
and
port
to
connect
in
new
diagram
connector
.
StartPlug
.
Connect
(
source
Shape
Port
);
connector
.
EndPlug
.
Connect
(
target
Shape
Part
);
connector
.
Reroute
();//
Not
working
&
nbsp
; }
}
Source
Diagram
:
Routing
is
not
correct
in
copying
diagram
Please
suggest
that
how
can
we
correct
routing
of
these
dynamically
added
shape
s
in
the
drawing
100
;
ocument
.
Note
:
All
events
are
detached
from
these
diagrams
.
Tags
Diagram
Routing
issue
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search