개정판 a64513ee
cad symbol angle test
Change-Id: Ie687609ca71a811791dedeae45ab566c8d0732e0
DTI_PID/DTI_PID/ImportTextFromCADDialog.py | ||
---|---|---|
1 | 1 |
# coding: utf-8 |
2 | 2 |
"""This is text importing module from AutoCAD""" |
3 |
import math |
|
3 | 4 |
import os |
4 | 5 |
import sys |
5 | 6 |
from PyQt5.QtCore import * |
... | ... | |
939 | 940 |
name = blk_ref_node.attrib['Name'] |
940 | 941 |
origin = convert_to_image_coords((float(blk_ref_node.attrib['X']), float(blk_ref_node.attrib['Y'])), |
941 | 942 |
[scale_x, scale_y], offsets) |
942 |
angle = round(float(blk_ref_node.attrib['Angle']), 2) |
|
943 | 943 |
flip = float(blk_ref_node.attrib['ScaleFactors'].replace('(', '').replace(')', '').split(',')[0]) |
944 | 944 |
flip = 1 if flip < 0 else 0 |
945 |
if flip == 0: |
|
946 |
angle = round(2 * math.pi - float(blk_ref_node.attrib['Angle']), 2) |
|
947 |
else: |
|
948 |
angle = round(float(blk_ref_node.attrib['Angle']), 2) |
|
945 | 949 |
|
946 | 950 |
"""check if maxtents or minextents attribute exists""" |
947 | 951 |
if 'MaxExtents' not in blk_ref_node.attrib or 'MinExtents' not in blk_ref_node.attrib: |
내보내기 Unified diff