cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

copy a diagram

veldewclrt
New Contributor

Hello,

 

I want to copy diagrams using a script. The intension is also to modify some things, but first step is to completely copy them.

I managed to create a new diagram, put all objects from the source diagram on the new one, same place and automatically the lines are there also.

However, the lines are all straight forward and i need them to reposition on the exact same way as the original diagram.

This means line type(orthogonal) and waypoints on the line.

 

Is there a way to loop through the lines in the original (can do that) and from this, get the copy of that line in the new diagram to change properties there (i'm lost here)

 

Any help is appreciated !

 

kr,

Wim VdV

2 Replies

Hi,

 

My issue is not how to retrieve the points of the line, its more on retrieving the line itself.

for example :

 

I have a diagram A, created a copy of it A'

 

on diagram A :

for each line 

  get points

  get corresponding line on diagram A'      <-- this is my problem

  Set points on line in A'

next

gquiniou
Retired

Hi Wim,

 

You can retrieve a collection containing the points by calling  "ItemProperty("DrwLine_Points")" on the drawingItem that represents your link.

For example:


Set points = mydrawingitem.ItemProperty("DrwLine_Points")
points.InsertPointBefore points.count -1, xcoordinate, ycoordinate
mydrawingitem.ItemProperty("DrwLine_Points") = points

 

Regards,

 

Gregory