개정판 be2f18b3
xml gen added
Change-Id: Iddce18298d7d785571047f8bda75fde1ba1cb11a
DTI_PID/DTI_PID/ImportTextFromCADDialog.py | ||
---|---|---|
1003 | 1003 |
id2_image_file = os.path.join(drawing_path, file_name + '.png') |
1004 | 1004 |
autocad_xml_path = os.path.join(os.path.dirname(_file), os.path.splitext(os.path.basename(_file))[0] + '.xml') |
1005 | 1005 |
matches = [id2_xml_file for id2_xml_file in id2_xml_files if id2_xml_file.replace(file_name, '').upper() == '.XML'] |
1006 |
|
|
1007 |
if not matches: |
|
1008 |
path = os.path.join(app_doc_data.getCurrentProject().getTempPath(), file_name + '.xml') |
|
1009 |
img = AppDocData.my_imread(file_path=id2_image_file) |
|
1010 |
_width = img.shape[1] |
|
1011 |
_height = img.shape[0] |
|
1012 |
xml, result = xg.write_to_xml(path, _width, _height, [], []) |
|
1013 |
if xml: |
|
1014 |
from xml.etree import ElementTree |
|
1015 |
ElementTree.ElementTree(xml).write(path) |
|
1016 |
matches = [file_name + '.xml'] |
|
1017 |
|
|
1006 | 1018 |
if matches and os.path.exists(id2_image_file): |
1007 | 1019 |
try: |
1008 | 1020 |
layers, line_types, symbols = [], [], [] |
... | ... | |
1153 | 1165 |
_name = blk_ref_node.attrib['Name'] |
1154 | 1166 |
if '+' in _name: |
1155 | 1167 |
name = _name.split('+')[1] |
1156 |
type = _name.split('+')[2]
|
|
1168 |
type = _name.split('+')[0]
|
|
1157 | 1169 |
else: |
1158 | 1170 |
name = _name |
1159 | 1171 |
type = 'Valves' |
내보내기 Unified diff