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

Can you access the "reorganize drawing" functionality via a VB API operation call ?

lrobinet
MEGA
MEGA
While in a diagram, with the "Drawing" menu, we can choose "Reorganize drawing" in different formats (hierarchical, barycentric, orthagonal). This functionality calculates the objects and links of the diagram and arranges them to result in a readable drawing.
 
Is this functionality accesible via Diagram APIs ?
4 Replies

Thanks, it works.

 

FYI, the result is more efficient with the GUI. The layout is less compact with the API, wich can be a drawback for complex diagrams (larger generated image).

 

Example in attachment.

 

Best regards

 

 

Hello

 

OK After further check there is an additional parameter

ArrangeLayout(LayoutType, LineStyle)

 

Possible values for LayoutType:

  • spring layout :  1
  • orthogonal layout : 2
  • hierarchical layout : 4
  • horizontal hierarchical layout : 8
  • invert hierarchical layout : 22
  • invert horizontal hierarchical layout : 50

Possible values for LineStyle:

  • straight : 0
  • orthogonal : 1

 

Jerome

Hello,

 

I tried the ArrangeLayout function with values from 0 to 10, but received this message :

 

Error(0x800a01c2) : Nombre d'arguments ou affectation de propriété incorrects: 'oDraw.ArrangeLayout'

 

What are the possible values for 'LayoutTypeLineStyle' argument ?

 

 

jhorber
MEGA
MEGA

Hello Leslie

 

Yes. A function ArrangeLayout is available for the MegaDrawing object

Ex: MyDrawing.ArrangeLayout(LayoutTypeLineStyle)



 

 

Jerome