cancel
Showing results for 
Search instead for 
Did you mean: 

Diagram API - Add Simple Shape, Text

Solved
Highlighted
Contributor

Diagram API - Add Simple Shape, Text

Hi,

 

Regarding Diagram API, I can add Mega Object using MegaObjectInsert function. Is there any function that I can use to add simple Shape or Text (not a Mega Object) to the diagram? Thanks

2 Replies
MEGA

Re: Diagram API - Add Simple Shape, Text

Hi,

 

You can use the Sub function

 

CreateDrawingItem (DrwItemClass As String,
DrwItemCreateParam As String, DrawItemParent As MegaDrawingItem,
InsertMode As Integer)

 

from a MegaDrawing object.

 

Then you give it a DrwItemClass as parameters.

 

- Available DrwItemClass class options are:
"DrwRectangle"
"DrwFoldedCorner"
"DrwOblong"
"DrwEllipse"
"DrwRoundRect"
"DrwLozenge"
"DrwLine"
"DrwText"
"DrwShape"
"DrwSmartPolygon"

 

For instance,

 

To create a rectangle:

 

Set oRectangle = oMegaDrawing.CreateDrawingItem("DrwRoundRect")

 

To create a Text zone

 

Set zoneText = oMegaDrawing.CreateDrawingItem("DrwText", "Modifiée le" & Date)

 

 

Sébastien

 

Contributor

Re: Diagram API - Add Simple Shape, Text

Thanks, Sébastien! It works.