From 47db1d24d8ff38058bdaf4c257192769115dbf07 Mon Sep 17 00:00:00 2001 From: alvinpenner Date: Thu, 7 May 2009 00:26:14 +0000 Subject: [PATCH] fix LP bug 293940, comment 73 --- share/extensions/dxf_input.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/share/extensions/dxf_input.py b/share/extensions/dxf_input.py index 8305ae149..e4cfc3b55 100644 --- a/share/extensions/dxf_input.py +++ b/share/extensions/dxf_input.py @@ -310,11 +310,12 @@ DIMTXT = {} # store DIMENSION text sizes while line[0] and line[1] != 'BLOCKS': line = get_line() - if line[1] == '$EXTMIN': - xmin = get_group('10') - if line[1] == '$EXTMAX': - xmax = get_group('10') - ymax = get_group('20') + if options.auto: + if line[1] == '$EXTMIN': + xmin = get_group('10') + if line[1] == '$EXTMAX': + xmax = get_group('10') + ymax = get_group('20') if flag == 1 and line[0] == '2': layername = unicode(line[1], "iso-8859-1") attribs = {inkex.addNS('groupmode','inkscape'): 'layer', inkex.addNS('label','inkscape'): '%s' % layername} @@ -348,6 +349,11 @@ else: desc.text = '%s - scale = %f' % (unicode(args[0], "iso-8859-1"), scale) scale *= 90.0/25.4 # convert from mm to pixels +if not layer_nodes: + attribs = {inkex.addNS('groupmode','inkscape'): 'layer', inkex.addNS('label','inkscape'): '0'} + layer_nodes['0'] = inkex.etree.SubElement(doc.getroot(), 'g', attribs) + layer_colors['0'] = 7 + for linename in linetypes.keys(): # scale the dashed lines linetype = '' for length in linetypes[linename]: -- 2.30.2