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

Diagram API - Add Simple Shape, Text

linhbui
Super Contributor

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

linhbui
Super Contributor

Thanks, Sébastien! It works.

STrang
Retired

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