pydia: get connection direction



Hi,

I use Dia with the Python plugin (pyida) downloaded following the instructions from http://dia-installer.de/howto/python_win32/ .

I want to write an export filter that print the objects (like boxes) and the connection of these boxes into a XML file (see the attached Dia XML file). Export-object.py from the Dia's installation folder gives a good start, it also prints the connections but not the connection direction. In other words I do not now where the arrow of the connections points to. But the information is saved in Dia file, see lines 171-174 in the attached file:
      <dia:connections>
        <dia:connection handle="0" to="O0" connection="8"/>
        <dia:connection handle="1" to="O1" connection="8"/>
      </dia:connections>
The handle="0" is the start point and handle="1" is the endpoint. That is nice but I cannot find this information in the Python representation. The other information of the line like
   <dia:object type="UML - Message" version="0" id="O2">
      <dia:attribute name="obj_pos">
        <dia:point val="12.446,12.9963"/>
      </dia:attribute>
      <dia:attribute name="obj_bb">
        <dia:rectangle val="12.3959,12.5783;24.351,13.6874"/>
      </dia:attribute>
...
can be found if you enter
   dia.active_display().diagram.data.layers[0].objects[2].properties.keys()
in the Python console. I did browe around the the connection- and handlers field but could not find the detailed connection information.

Can you please help me?

TIA  Martin
  

Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die   
Toolbar eingebaut! http://produkte.web.de/go/toolbar

Attachment: diagramm5.dia
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]