Looking for an open source solution to extract CAD annotations to one or several common OGR vector formats (DXF, Geopackage, shapefile ..). Output data must contains at least text and rotation.
After playing a bit ... OGR does have solutions to extract more informations from DXF.
Using OGR_STYLE with ogrinfo/ogr2ogr CLI
ogrinfo PROJET.dxf -sql "select OGR_STYLE from entities where Layer = '3ZONCOMMTEX'"
Style = LABEL(f:"Arial",t:"Route",p:1,a:32.1,s:2.5g,c:#000000)
GetStyleString() function (OGR Python Binding)
import ogr driver = ogr.GetDriverByName("DXF") source = driver.Open("PROJET.dxf") layer = source.GetLayer() fields = layer.GetLayerDefn() for feat in layer: style = feat.GetStyleString() print(style) # LABEL(f:"Arial",t:"Route",p:1,a:32.1,s:2.5g,c:#000000)