我想使用dxfwrite或ezdxf沿(WCS) y方向创建文本,并在(WCS) z方向创建高度。
使用autocad时,我已通过设置UCS并输入文字来完成此操作。
在dxfwrite或ezdxf (或任何其他python友好库)中该如何操作?
dxf.ucs('textucs',xaxis=(0.,1.,0),yaxis=(0.,0.,1.))
lab = dxf.mtext('hello',np.array([0.,0.,.5]),layer='mylay',height=0.3)不工作,大概是因为我只创建了UCS,并没有使用它。
发布于 2017-02-19 00:33:07
定义UCS没有任何作用,dxfwrite/ezdxf不是CAD应用程序。
此示例使用ezdxf在YZ平面中写入文本:
import ezdxf
dwg = ezdxf.new('ac1015')
modelspace = dwg.modelspace()
modelspace.add_mtext("This is a text in the YZ-plane",
dxfattribs={
'width': 12, # reference rectangle width
'text_direction': (0, 1, 0), # write in y direction
'extrusion': (1, 0, 0) # normal vector of the text plane
})
dwg.saveas('mtext_in_yz_plane.dxf')dxfwrite中的多行文字只是一堆文字图元,因为多行文字图元需要DXF13或更高版本。
https://stackoverflow.com/questions/42314045
复制相似问题