Re: add attributes?
- From: Carl Karsten <carl personnelware com>
- To: discussions about usage and development of dia <dia-list gnome org>
- Subject: Re: add attributes?
- Date: Sun, 08 Feb 2009 09:12:57 -0600
Steffen Macke wrote:
Hi,
1. Define new attributes.
2. Set attribute values on objects. These 3 attributes would now be part of
I think this is already possible. Have a look at the "Extended
Attributes" of custom
shapes in the Dia Manual:
http://dia-installer.de/doc/en/custom-shapes-chapter.html#N40FD5
These extended attributes are accessible in python.
Example:
* Add an extended attribute called "Description" to a shape.
* Create a new diagram
* Add your new shape
* Edit the object properties and write a description
* Use the following statement in the Python Dia Console:
dia.active_display().diagram.data.layers[0].objects[0].properties['custom:Description'].value
I hope that this information is sufficient for you to create such
custom shapes and adjust
the python export script. If not, I should post a sample.
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?)
"The effect will be some custom properties in your object. They are editable by
the properties dialog and will be loaded and saved with your diagram. "
Looks very promising.
Carl K
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]