Draft: Fixes in DXF exporter
This commit is contained in:
parent
58dd79e79b
commit
1446ee0b69
|
@ -278,6 +278,10 @@ def getGroupContents(objectslist,walls=False):
|
|||
newlist = []
|
||||
for obj in objectslist:
|
||||
if obj.isDerivedFrom("App::DocumentObjectGroup"):
|
||||
if obj.isDerivedFrom("Drawing::FeaturePage"):
|
||||
# skip if the grou is a page
|
||||
newlist.append(obj)
|
||||
else:
|
||||
newlist.extend(getGroupContents(obj.Group))
|
||||
else:
|
||||
newlist.append(obj)
|
||||
|
|
|
@ -1487,8 +1487,12 @@ def export(objectslist,filename,nospline=False):
|
|||
global exportList
|
||||
exportList = objectslist
|
||||
|
||||
print exportList
|
||||
|
||||
exportList = Draft.getGroupContents(exportList)
|
||||
|
||||
print exportList
|
||||
|
||||
if (len(exportList) == 1) and (Draft.getType(exportList[0]) == "ArchSectionView"):
|
||||
# arch view: export it "as is"
|
||||
dxf = exportList[0].Proxy.getDXF()
|
||||
|
|
|
@ -413,8 +413,10 @@ class svgHandler(xml.sax.ContentHandler):
|
|||
|
||||
data = {}
|
||||
for (keyword,content) in attrs.items():
|
||||
#print keyword,content
|
||||
content = content.replace(',',' ')
|
||||
content = content.split()
|
||||
#print keyword,content
|
||||
data[keyword]=content
|
||||
|
||||
if 'style' in data:
|
||||
|
@ -434,6 +436,9 @@ class svgHandler(xml.sax.ContentHandler):
|
|||
for k in ['fill','stroke','stroke-width','font-size']:
|
||||
if k in data:
|
||||
if isinstance(data[k],list):
|
||||
if data[k][0].lower().startswith("rgb("):
|
||||
data[k] = ",".join(data[k])
|
||||
else:
|
||||
data[k]=data[k][0]
|
||||
|
||||
# extracting style info
|
||||
|
@ -748,7 +753,11 @@ class svgHandler(xml.sax.ContentHandler):
|
|||
path.append(seg)
|
||||
elif (d == "Z") or (d == "z"):
|
||||
if not DraftVecUtils.equals(lastvec,firstvec):
|
||||
try:
|
||||
seg = Part.Line(lastvec,firstvec).toShape()
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
path.append(seg)
|
||||
if path: #the path should be closed by now
|
||||
#sh=makewire(path,True)
|
||||
|
|
Loading…
Reference in New Issue
Block a user