- UID
- 76071
- 积分
- 1505
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2003-8-30
- 最后登录
- 1970-1-1
|
发表于 2004-11-24 09:24:34
|
显示全部楼层
帮助里不是有麽?
Sub Example_ActiveUCS()
' This example returns the current UCS
' and then sets a new UCS.
' Finally, it returns the UCS to the previous setting.
Dim newUCS As AcadUCS
Dim currUCS As AcadUCS
Dim origin(0 To 2) As Double
Dim xAxis(0 To 2) As Double
Dim yAxis(0 To 2) As Double
' Return current UCS of active document
Set currUCS = ThisDrawing.ActiveUCS
MsgBox "The current UCS is " & currUCS.Name, vbInformation, "ActiveUCS Example"
' Create a UCS and makes it current
origin(0) = 0: origin(1) = 0: origin(2) = 0
xAxis(0) = 1: xAxis(1) = 1: xAxis(2) = 0
yAxis(0) = -1: yAxis(1) = 1: yAxis(2) = 0
Set newUCS = ThisDrawing.UserCoordinateSystems.Add(origin, xAxis, yAxis, "_TestUCS")
ThisDrawing.ActiveUCS = newUCS
MsgBox "The new UCS is " & newUCS.Name, vbInformation, "ActiveUCS Example"
' Reset the UCS to its previous setting
ThisDrawing.ActiveUCS = currUCS
MsgBox "The UCS is reset to " & currUCS.Name, vbInformation, "ActiveUCS Example"
End Sub |
|