개정판 7c851884
fix cad text
Change-Id: I4ec5a01c0fe1325ee5c1d61903f139be3a1b7fd2
DTI_PID/DTI_PID/ImportTextFromCADDialog.py | ||
---|---|---|
1140 | 1140 |
"""up to here""" |
1141 | 1141 |
|
1142 | 1142 |
"""add text, line and symbol from autocad file to id2 xml file""" |
1143 |
if 'Text' in will_be_converted_items: # text for attrdef |
|
1144 |
for record in autocad_xml_root.iter('AcDbAttributeDefinition'): |
|
1145 |
for record in autocad_xml_root.iter('AcDbText'): |
|
1146 |
if record.attrib['Layer'] not in exclude_layers: |
|
1147 |
node = self.text_to_xml(record) |
|
1148 |
if node: |
|
1149 |
textInfo.append(node) |
|
1143 |
#if 'Text' in will_be_converted_items: # text for attrdef
|
|
1144 |
# for record in autocad_xml_root.iter('AcDbAttributeDefinition'):
|
|
1145 |
# for record in autocad_xml_root.iter('AcDbText'):
|
|
1146 |
# if record.attrib['Layer'] not in exclude_layers:
|
|
1147 |
# node = self.text_to_xml(record)
|
|
1148 |
# if node:
|
|
1149 |
# textInfo.append(node)
|
|
1150 | 1150 |
|
1151 | 1151 |
for blk_tbl_record in autocad_xml_root.iter('AcDbBlockTableRecord'): |
1152 | 1152 |
if blk_tbl_record.attrib['Name'].upper() != '*Model_Space'.upper() or \ |
... | ... | |
1469 | 1469 |
loc = self.convert_to_image_coords([float(text_node.attrib['X']), float(text_node.attrib['Y'])]) |
1470 | 1470 |
|
1471 | 1471 |
text = text_node.text |
1472 |
#if text == '323001B': |
|
1473 |
# print('a') |
|
1472 |
if not text.replace(' ', '').replace('\n', ''): |
|
1473 |
return |
|
1474 |
if text == 'PID-1104': |
|
1475 |
print('a') |
|
1474 | 1476 |
angle = round(float(text_node.attrib['Angle']), 2) |
1475 | 1477 |
if 'IsMirroredInX' in text_node.attrib and text_node.attrib['IsMirroredInX'] == 'True': |
1476 | 1478 |
if abs(math.pi * 0.5 - angle) < 0.01 or abs(math.pi * 1.5 - angle) < 0.01: |
내보내기 Unified diff