Hi,

> Please do.  I read over that page, and am not sure where to start.  I get
> the feeling I would need to start over and create a new .dia, and might be
> limited to what objects I can use?  (like can I use the laptop object?)

You'll have to create custom shapes for all objects you want to use with the
custom description attribute. For special objects like the UML shapes this might
result in a loss of functionality. But e.g. all the Cisco objects
should be fine.

You can follow the instructions to add new shapes to Dia:

http://dia-installer.de/howto/create_shape/index.html

Instead of actually drawing a new shape, just create an empty diagram
and drag one of the shapes you need customized onto the diagram.

After exporting the shape, use a text editor to add the following in
line 3 of the *.shape file:

<ext_attributes>
  <ext_attribute name="Description" type="string" />
</ext_attributes>

You may also want to edit the <name></name> attribute in the file.

Now continue with adding the shape to a sheet (your custom sheet)?

Repeat for all the shapes you need.

Draw your diagram using your customized shapes. Enter the descriptions
through the object properties.

Export the shape using the attached updated PyDia List Generation
script. It will output shape names as well as the description
attributes. Shapes that don't have a custom description attribute will
be omitted.

Regards,

Steffen
#	PyDia List Generation from Diagram
#
#	Copyright (c) 2009  Steffen Macke <[email protected]>
#
#    This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

import sys, dia

class ListRenderer :
	
	def begin_render (self, data, filename) :
		f = open(filename, "w")
		for layer in data.layers :
			for o in layer.objects :
				if 'custom:Description' in o.properties.keys():
					f.write(o.type.name+", "+o.properties["custom:Description"].value+"\n")	
		f.close()
		
dia.register_export ("PyDia List Generation", "txt", ListRenderer())
_______________________________________________
dia-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia

Reply via email to