怎么用VBA在CAD布局图中加文字
1个回答
展开全部
Sub Example_AddText()
Dim textObj As AcadText
Dim textString As String
Dim insertionPoint(0 To 2) As Double
Dim height As Double
' Define the text object
textString = "Hello, World."
insertionPoint(0) = 2: insertionPoint(1) = 2: insertionPoint(2) = 0
height = 0.5
ThisDrawing.ActiveLayout = ThisDrawing.Layouts("布局2") '激活指定布局
' Create the text object in model space
Set textObj = ThisDrawing.PaperSpace.AddText(textString, insertionPoint, height) '在图纸空间(刚激活的)添加文字;
ZoomAll
End Sub
Dim textObj As AcadText
Dim textString As String
Dim insertionPoint(0 To 2) As Double
Dim height As Double
' Define the text object
textString = "Hello, World."
insertionPoint(0) = 2: insertionPoint(1) = 2: insertionPoint(2) = 0
height = 0.5
ThisDrawing.ActiveLayout = ThisDrawing.Layouts("布局2") '激活指定布局
' Create the text object in model space
Set textObj = ThisDrawing.PaperSpace.AddText(textString, insertionPoint, height) '在图纸空间(刚激活的)添加文字;
ZoomAll
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询