Fixed dimension text height bug in Draft DXF import
This commit is contained in:
parent
a912de03ea
commit
98fc92e05a
|
@ -104,6 +104,17 @@ def locateLayer(wantedLayer):
|
||||||
layers.append(newLayer)
|
layers.append(newLayer)
|
||||||
return newLayer
|
return newLayer
|
||||||
|
|
||||||
|
def getdimheight(style):
|
||||||
|
"returns the dimension text height from the given dimstyle"
|
||||||
|
for t in drawing.tables.data:
|
||||||
|
if t.name == 'dimstyle':
|
||||||
|
for a in t.data:
|
||||||
|
if hasattr(a,"type"):
|
||||||
|
if a.type == "dimstyle":
|
||||||
|
if rawValue(a,2) == style:
|
||||||
|
return rawValue(a,140)
|
||||||
|
return None
|
||||||
|
|
||||||
def calcBulge(v1,bulge,v2):
|
def calcBulge(v1,bulge,v2):
|
||||||
'''
|
'''
|
||||||
calculates intermediary vertex for curved segments.
|
calculates intermediary vertex for curved segments.
|
||||||
|
@ -966,6 +977,11 @@ def processdxf(document,filename):
|
||||||
dim.layer = layer
|
dim.layer = layer
|
||||||
dim.color_index = 256
|
dim.color_index = 256
|
||||||
fmt.formatObject (newob,dim)
|
fmt.formatObject (newob,dim)
|
||||||
|
if fmt.stdSize:
|
||||||
|
newob.ViewObject.FontSize = FreeCADGui.draftToolBar.fontsize
|
||||||
|
else:
|
||||||
|
st = rawValue(dim,3)
|
||||||
|
newob.ViewObject.FontSize = float(getdimheight(st))
|
||||||
|
|
||||||
else: FreeCAD.Console.PrintMessage("skipping dimensions...\n")
|
else: FreeCAD.Console.PrintMessage("skipping dimensions...\n")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user