1 # Copyright (C) 2013-2018 Roland Lutz
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 rev
= xorn
.storage
.Revision()
22 data
= xorn
.storage
.Line()
29 ob
= rev
.add_object(data
)
32 ## [get/set object data]
33 data
= rev
.get_object_data(ob
)
35 rev
.set_object_data(ob
, data
)
36 ## [get/set object data]
39 for ob
in rev
.get_objects():
40 data
= rev
.get_object_data(ob
)
41 # do something with ob and data
44 component_data
= xorn
.storage
.Component()
45 component
= rev
.add_object(component_data
)
48 text_data
= xorn
.storage
.Text()
49 text_data
.text
= "refdes=R1"
51 ob
= rev
.add_object(text_data
)
52 rev
.relocate_object(ob
, component
, None)