self._fillAttribute(self._base, base)
pass
- def setSizes(self, to_size, from_size):
+ def setSizes(self, to_size, from_size, to_size_text="", from_size_text=""):
"""Modify the to_size, from_size attributes of the feature.
See __init__.
# values without changes that causes cyclic dependency
#self.__clear()
self._fillAttribute(self._CreationMethod, "BySizes")
- self._fillAttribute(self._to_size, to_size)
- self._fillAttribute(self._from_size, from_size)
+ if to_size_text == "":
+ self._fillAttribute(self._to_size, to_size)
+ else:
+ self._fillAttribute(self._to_size, to_size_text)
+
+ if from_size_text == "":
+ self._fillAttribute(self._from_size, from_size)
+ else:
+ self._fillAttribute(self._to_size, from_size_text)
pass
- def setSize(self, size):
+ def setSize(self, size, text=""):
"""Modify the size of the feature.
If size is positive then initialize to_size with size.
If size is negative then initialize from_size with -size.
"""
to_size, from_size = 0, 0
+ to_size_text, from_size_text = "", ""
if size >= 0:
to_size = size
+ to_size_text = text
else:
from_size = -size
+ from_size_text = text
+
+ self.setSizes(to_size, from_size, to_size_text, from_size_text)
- self.setSizes(to_size, from_size)
pass
def setPlanesAndOffsets(self, to_object, to_offset,
height_text = self.getTextInput(self.HEIGHT_ID())
# Editing the box
- self.base.setValue(self.width, width)
- self.base.setText(self.width, width_text)
+ if width_text == "":
+ self.base.setValue(self.width, width)
+ else:
+ self.base.setText(self.width, width_text)
- self.base.setValue(self.length, length)
- self.base.setText(self.length, length_text)
+ if length_text != "":
+ self.base.setValue(self.length, length)
+ else:
+ self.base.setText(self.length, length_text)
- self.box.setSize(height)
+ self.box.setSize(height, height_text)
# Publishing the result: not needed for Macro feature
# self.addResult( self.box.result() )