|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。
2 o7 S! m) J1 ^7 u 但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?5 D \% p! W; f2 x4 X( s4 ~
代码如下:
5 z: Q/ u6 D+ R" ?1 XSub Example_Center(); j1 u- t; p. P
Dim circObj As AcadCircle
* R6 k) o* P# s0 B7 B0 K' F Dim currCenterPt(0 To 2) As Double, Y! }8 D: _+ F
Dim newCenterPt(0 To 2) As Double4 ^" }8 w3 E: G( ]1 Y* b6 G
Dim radius As Double% n: E4 D1 K \3 X7 Z; o
' Define the initial center point and radius for the circle! D' C$ U& R3 R9 B3 i
currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
+ j' \7 x% x& S% J3 s7 F radius = 3
4 l: Y/ S8 |/ o3 q" h$ _ ' Create the circle in model space5 X& P$ q n" Y- l
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
2 g* D$ P& e/ ~/ C1 K* h) [ ZoomAll
& _ A- l. ^% @ MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"( z' e3 I& s7 c+ s9 d! [- Y6 t- B. Y
End Sub |
|