2
# -*- coding: utf-8 -*-
4
# LORZE erasandcad, a 2D CAD with an intuitive user interface, simple and easy.
5
# http://erasand.jimdo.com/python-programme/lorze/
6
# (C) 2012, Andreas Ulrich
8
# 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 3 of the License, or (at your option) any later version.
10
# 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.
12
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
14
from lrzgeohelp import LorzeGeoHelp
17
# line object of LORZE erasandcad
23
# coordinates, float, x1, y1, x2, y2
24
self.__x1, self.__y1, self.__x2, self.__y2= 0.0, 0.0, 0.0, 0.0
39
def SetId(self, lrzid):
47
def SetCoords(self, x1, y1, x2, y2):
55
return(self.__x1, self.__y1, self.__x2, self.__y2)
59
# get outline rectangle, x, y, w, h
60
geohelp= LorzeGeoHelp()
61
return(geohelp.RectXYtoWH(self.__x1, self.__y1, self.__x2, self.__y2))
64
def SetColor(self, color):
72
def SetLayer(self, layer):
80
def SetStyle(self, style):
88
def SetWidth(self, width):
112
if __name__== '__main__':
114
line.SetId('L123456789')
115
line.SetCoords(-20, -30, 20, 30)
116
line.SetColor('Black')
117
line.SetLayer('Test')
118
line.SetStyle('Solid')
119
line.SetWidth('1 mm')
121
print('Element-ID:', line.GetId())
122
print('coordinates:', line.GetCoords())
123
print('X1:', line.GetX1())
124
print('Y1:', line.GetY1())
125
print('X2:', line.GetX2())
126
print('Y2:', line.GetY2())
127
print('outline rectangle:', line.GetRec())
128
print('colour:', line.GetColor())
129
print('layer:', line.GetLayer())
130
print('penstyle:', line.GetStyle())
131
print('pensize:', line.GetWidth())