马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
用VBAScrip向drafting添加文本框,如何更改文本框名称及字体颜色?
添加文本代码如下。
Language="VBSCRIPT"
Sub CATMain()
Set DrwDocument = CATIA.ActiveDocument
Set DrwSheets = DrwDocument.Sheets
Set Selection = DrwDocument.Selection
Set DrwSheet = DrwSheets.ActiveSheet
Dim x as Real
Dim y as Real
x = 205
x = DrwSheet.GetPaperWidth - x
y = 7.5
Dim oDoc As DrawingDocument
Dim oBackGround As DrawingView
Dim oText As DrawingText
Set oDoc = CATIA.ActiveDocument
Set oBackGround = oDoc.Sheets.ActiveSheet.Views.Item(2)
Set oText = oBackGround.Texts.Add(“Test", x, y)
oText.AnchorPosition = catBottomRight
oText.SetFontSize 0,0,7
oText.SetFontName 0,0, "SSS4"
End Sub |