개정판 8a26ef70
issue #1493: BlockAttribute의 IsMirroredInX, IsMirroredInY 속성 적용
Change-Id: Ief516139ba64ddae6dabb60e3c98c5484eeda4c2
DTI_PID/DTI_PID/ImportTextFromCADDialog.py | ||
---|---|---|
871 | 871 |
symbols_node.append(node) |
872 | 872 |
|
873 | 873 |
if 'Text' in will_be_converted_items: |
874 |
angle = round(float(blk_ref.attrib['Angle']), 2) |
|
874 | 875 |
for record in blk_ref.iter('AcDbAttribute'): |
875 | 876 |
node = self.text_to_xml(record, id2_bbox_text, autocad_bbox) |
876 | 877 |
if node: |
... | ... | |
997 | 998 |
@param autocad_bbox: |
998 | 999 |
@return: |
999 | 1000 |
""" |
1000 |
import uuid
|
|
1001 |
import math
|
|
1001 | 1002 |
from EngineeringTextItem import QEngineeringTextItem |
1002 | 1003 |
|
1003 | 1004 |
try: |
1004 |
scale_x = max([id2_bbox[2] / autocad_bbox[2], id2_bbox[3] / autocad_bbox[3]]) if self.ui.doubleSpinBox.value() < 1 else self.ui.doubleSpinBox.value() |
|
1005 |
scale_y = max([id2_bbox[2] / autocad_bbox[2], id2_bbox[3] / autocad_bbox[3]]) if self.ui.doubleSpinBox_2.value() < 1 else self.ui.doubleSpinBox_2.value() |
|
1005 |
scale_x = max([id2_bbox[2] / autocad_bbox[2], id2_bbox[3] / autocad_bbox[3]]) \ |
|
1006 |
if self.ui.doubleSpinBox.value() < 1 else self.ui.doubleSpinBox.value() |
|
1007 |
scale_y = max([id2_bbox[2] / autocad_bbox[2], id2_bbox[3] / autocad_bbox[3]]) \ |
|
1008 |
if self.ui.doubleSpinBox_2.value() < 1 else self.ui.doubleSpinBox_2.value() |
|
1006 | 1009 |
offsets = [id2_bbox[0] + self.ui.spinBoxTextX.value() - autocad_bbox[0] * scale_x, |
1007 | 1010 |
(id2_bbox[1] + id2_bbox[3]) + self.ui.spinBoxTextY.value() - autocad_bbox[1] * scale_y] |
1008 | 1011 |
|
... | ... | |
1011 | 1014 |
|
1012 | 1015 |
text = text_node.text |
1013 | 1016 |
angle = round(float(text_node.attrib['Angle']), 2) |
1017 |
if 'IsMirroredInX' in text_node.attrib and text_node.attrib['IsMirroredInX'] == 'True': |
|
1018 |
if abs(math.pi*0.5 - angle) < 0.01 or abs(math.pi*1.5 - angle) < 0.01: |
|
1019 |
angle += math.pi |
|
1020 |
angle = angle - math.pi*2 if angle > math.pi*2 else angle |
|
1021 |
|
|
1022 |
if 'IsMirroredInY' in text_node.attrib and text_node.attrib['IsMirroredInY'] == 'True': |
|
1023 |
if abs(angle) < 0.01 or abs(math.pi - angle) < 0.01: |
|
1024 |
angle += math.pi |
|
1025 |
angle = angle - math.pi*2 if angle > math.pi*2 else angle |
|
1014 | 1026 |
|
1015 | 1027 |
_height = round(float(text_node.attrib['Height']) * scale_y) |
1016 | 1028 |
loc[1] -= _height |
내보내기 Unified diff