文本对齐
<p>以X坐标一点中心对齐 X=775,y坐标提取就是.InsertionPoint(1)</p><p>如pp(0) = 775: pp(1) = .InsertionPoint(1): pp(2) = 0<br/>程序如下:</p><p>Sub ls()<br/> Dim objText As AcadText, Ent As AcadEntity<br/> Dim pp(0 To 2) As Double ', alignmentPoint(0 To 2) As Double<br/> For Each Ent In ThisDrawing.ModelSpace<br/> Set objText = Ent<br/> With objText<br/> <br/> pp(0) = 775: pp(1) = .InsertionPoint(1): pp(2) = 0<br/> 'alignmentPoint(0) = 775: alignmentPoint(1) = .InsertionPoint(1): alignmentPoint(2) = 0<br/> 'Debug.Print .InsertionPoint(1), .TextString<br/> For jj = 0 To 2<br/> Debug.Print .InsertionPoint(jj), pp(jj)<br/> Next jj<br/> .Alignment = acAlignmentCenter<br/> .TextAlignmentPoint = pp 'alignmentPoint<br/> <br/> End With<br/> Next<br/>End Sub<br/></p>
页:
[1]