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

Using API to have shape definition

chdollier
MEGA
MEGA

Hi, 

 

I'm using API to retrieve names of all used shapes for each object in my diagrams, according to documentation it consists in:

 

   dim drw

   set drw = diag.drawing

   for each obj in drw.DrawingObjects

        print obj.shape

    next

 

Everithing is fine with others attributes on MegaDrawingObject but not with Shape

 

Is there anything wrong with it? or another way to proceed.

 

Thanks for your help.

 

Regards

1 Reply

aaitqlila
MEGA
MEGA

The diagram can be “opened”, either for read-only or read/write access which will allow further manipulation. So you have to specify in which mode the diagram should be opened in your script:

 

set diag = getselection("select diagramme where _hexaidabs='xxxxxxxxxxxx'").item(1)
set drw = diag.drawing("RW")
dim obj
for each obj in drw.DrawingObjects
print obj.Shape

next

 

Aicha