CAD vba 创建文字样式
Sub TxtStyle07()
Dim TS As AcadTextStyles
Set TS = ThisDrawing.TextStyles
Dim TStyle As AcadTextStyle
Set TStyle = TS.Add("田草标准文字样式0.7")
Dim Ffile As String
Ffile = Application.Path & "\fonts\txt.shx"
'MsgBox Ffile
TStyle.fontFile = Ffile
TStyle.BigFontFile = Application.Path & "\fonts\hz (1).shx"
TStyle.width = 0.7
End Sub
Sub TxtStyleI()
Dim TS As AcadTextStyles
Set TS = ThisDrawing.TextStyles
Dim TStyle As AcadTextStyle
Set TStyle = TS.Add("田草标准文字样式-倾斜")
Dim Ffile As String
Ffile = Application.Path & "\fonts\txt.shx"
'MsgBox Ffile
TStyle.fontFile = Ffile
TStyle.BigFontFile = Application.Path & "\fonts\hz (1).shx"
TStyle.width = 0.7
TStyle.ObliqueAngle = 0.5
End Sub
‘设置为当前文字样式
Sub tt()
ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.item("standard")
End Sub
Dim TS As AcadTextStyles
Set TS = ThisDrawing.TextStyles
Dim TStyle As AcadTextStyle
Set TStyle = TS.Add("田草标准文字样式0.7")
Dim Ffile As String
Ffile = Application.Path & "\fonts\txt.shx"
'MsgBox Ffile
TStyle.fontFile = Ffile
TStyle.BigFontFile = Application.Path & "\fonts\hz (1).shx"
TStyle.width = 0.7
End Sub
Sub TxtStyleI()
Dim TS As AcadTextStyles
Set TS = ThisDrawing.TextStyles
Dim TStyle As AcadTextStyle
Set TStyle = TS.Add("田草标准文字样式-倾斜")
Dim Ffile As String
Ffile = Application.Path & "\fonts\txt.shx"
'MsgBox Ffile
TStyle.fontFile = Ffile
TStyle.BigFontFile = Application.Path & "\fonts\hz (1).shx"
TStyle.width = 0.7
TStyle.ObliqueAngle = 0.5
End Sub
‘设置为当前文字样式
Sub tt()
ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.item("standard")
End Sub
|
lhwscut 于 2011-02-04 01:38 PM 发表评论:
改为
TStyle.BigFontFile = "\fonts\hz (1).shx"
才能用???
发表评论 - 不要忘了输入验证码哦! |