如下,更改特定文字的属性
Sub edittext() Dim txtmapgis As AcadText Dim valtextheight As Double Dim txtobject As AcadObject For Each txtobject In ThisDrawing.ModelSpace If txtobject.ObjectName = "AcDbText" Then Set txtmapgis = txtobject valtextheight = CDbl(txtmapgis.Height) * 0.5 txtmapgis.Height = valtextheight 'Debug.Print valtextheight If txtmapgis.TextString = "设计" Then txtmapgis.color = acRed txtmapgis.Rotation = -1.414 txtmapgis.StyleName = "ddd" ' ddd为自己新建的文字样式 txtmapgis.Update
End If End If Next End Sub |