uilqing 发表于 2009-11-30 20:30:00

vba炸开cad-mtext字体

<p>Sub xmtext()<br/>Dim tsel As AcadSelectionSet<br/>Dim entry As AcadEntity<br/>Dim tpic As Variant<br/>Dim layerstr As String<br/>On Error Resume Next<br/>Set tsel = ThisDrawing.SelectionSets("topirolss")<br/>If Err Then<br/>Err.Clear<br/>Set tsel = ThisDrawing.SelectionSets.Add("topirolss")<br/>tsel.Clear<br/>End If<br/>tsel.Clear<br/>'ThisDrawing.Utility.GetEntity entry, tpic<br/>Err.Clear</p><p>layerstr = entry.Layer<br/>&nbsp;&nbsp; Dim FilterType(0) As Integer<br/>&nbsp;&nbsp; Dim FilterData(0) As Variant<br/>&nbsp;&nbsp; FilterType(0) = 0<br/>&nbsp;&nbsp; FilterData(0) = "Mtext"<br/>&nbsp;&nbsp; tsel.Select acSelectionSetAll, , , FilterType, FilterData<br/>&nbsp;&nbsp; tsel.Highlight (True)<br/>&nbsp;&nbsp; If tsel.Count = 0 Then<br/>&nbsp;&nbsp; tsel.Delete<br/>&nbsp;&nbsp; Else<br/>&nbsp;&nbsp; ThisDrawing.Utility.InitializeUserInput 1, "Move Copy Erase"<br/>&nbsp;&nbsp; ThisDrawing.SendCommand "x" &amp; vbCr &amp; "p" &amp; vbCr &amp; vbCr<br/>&nbsp;&nbsp; End If<br/>&nbsp;&nbsp; tsel.delete<br/>End Sub</p>

uilqing 发表于 2009-11-30 20:41:00

<p>另还想请教</p><p>&nbsp;我用选择集得到如下的范围</p><p></p><p>而用天正电气的到得是如下</p><p>&nbsp;</p><p></p><p></p><p>我知道是由于当前选择集不是自己定义的那个选择集</p><p>请教高手怎样设置当前选择集为自己定义的那个呢????</p>

PS122 发表于 2009-12-22 13:11:00

<p>学习了,谢谢</p><p></p>
页: [1]
查看完整版本: vba炸开cad-mtext字体