- UID
- 764874
- 积分
- 5
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2016-11-18
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Private Sub CommandButton1_Click()
Dim textObj As AcadText
Dim textString As String
Dim insertionPoint(0 To 2) As Double
Dim pp(0 To 2) As Double
ThisDrawing.Application.Documents.Add
For i = 0 To 5 '写文字
insertionPoint(0) = i * 200: insertionPoint(1) = 0: insertionPoint(2) = 0: '文字插入点
textString = Str(i + 1)
Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, 50)
Next i
ZoomAll
Dim mylayout As AcadLayout '定义布局
Dim myVport As AcadPViewport '定义视口
For i = 0 To 5 '新建5个布局
Set mylayout = ThisDrawing.Layouts.Add("P" + LTrim(Str(i + 1))) '新建布局
ThisDrawing.ActiveLayout = mylayout '激活布局
ThisDrawing.MSpace = True
'获取当前布局中的视口
Set myVport = ThisDrawing.ActivePViewport
myVport.Display True
myVport.Width = 200 '视口宽
myVport.height = 150 '视口高
myVport.CustomScale = 1
pp(0) = 125: pp(1) = 100: pp(2) = 0 '视口中心
myVport.Center = pp
ThisDrawing.MSpace = False
ZoomAll
Next i
'让 p1,p2,p3,p4,p5 视口分别显示 对应的1,2,3,4,5数字
'如何改变视口中视图的中心点
End Sub
|
|