Thanks Piyush.
Sorry for basic (!) questions - I'm an old time autolisp guy brushing off some cobwebs.
Playing with the process so far.
1) I have to move the first line date comment after the ?xml version
2) I'm getting an error with MTEXT object that has an '&' in it....
error on line 3 at column 49: xmlParseEntityRef: no name
<?xml version="1.0" encoding="UTF-8"?><!-- Fri May 23 17:45:51 2014 -->
<DwgData>
<DwgEntity type="IAcadMText" TextString="{\\This is fine & without the ampersand}" />
</DwgData>
3) I tried to open your 'multiline.dwg' but file is invalid for acad 2015. Creating my own file I get error in txttoxml.py
[ AutoCAD - Fri May 23 21:01:52 2014 ]----------------------------------------
<DwgEntity
#<VLA-OBJECT IAcadMText 00000000377693d8>
; IAcadMText: AutoCAD MText Interface
; Property values:
; Application (RO) = #<VLA-OBJECT IAcadApplication 000000013fba9110>
; AttachmentPoint = 1
; BackgroundFill = 0
; Document (RO) = #<VLA-OBJECT IAcadDocument 0000000036946858>
; DrawingDirection = 5
; EntityTransparency = "ByLayer"
; Handle (RO) = "24E"
; HasExtensionDictionary (RO) = 0
; Height = 2.5
; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000000034958358>
; InsertionPoint = (1496.32 1296.6 0.0)
; Layer = "0"
; LineSpacingDistance = 4.16667
; LineSpacingFactor = 1.0
; LineSpacingStyle = 1
; Linetype = "ByLayer"
; LinetypeScale = 1.0
; Lineweight = -1
; Material = "ByLayer"
; Normal = (0.0 0.0 1.0)
; ObjectID (RO) = 42
; ObjectName (RO) = "AcDbMText"
; OwnerID (RO) = 43
; PlotStyleName = "ByLayer"
; Rotation = 0.0
; StyleName = "Standard"
; TextString = "This is multiline text & on more than one line"
; TrueColor = #<VLA-OBJECT IAcadAcCmColor 00000000349581d0>
; Visible = -1
; Width = 25.3671
Traceback (most recent call last):
File "txttoxml.py", line 69, in <module>
for Line in FR:
File "c:\python34\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 227: character maps to <undefined>
Mtext 2013.dwg attached
Any ideas ?
Thanks
Neil