|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。, V0 J8 C% `0 D: ?/ L) `
但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?
/ t& O0 o* h7 V* o2 v 代码如下:
8 ]8 a$ L4 A( q$ ~% BSub Example_Center()
' u T8 j( k0 D2 @ Dim circObj As AcadCircle* U5 I) [6 R- x* c8 s; m
Dim currCenterPt(0 To 2) As Double
4 Y2 v$ c" K, C. }2 M2 e/ h5 q Dim newCenterPt(0 To 2) As Double$ i% Y5 s( f, m) k0 F- W/ i
Dim radius As Double
' B9 X1 I- @+ r' M. K- P* v ' Define the initial center point and radius for the circle
! t3 _1 j# _) r4 t; G1 ? currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
' w5 @. s1 b8 `+ L* s radius = 3 3 G/ ^$ v) {' v4 W Q
' Create the circle in model space
# N: U; q V4 G/ \& q* B4 n# T n Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius): P/ I% J, @6 a. k2 Z
ZoomAll
7 e# P& y3 n) V% o1 ? MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"% U2 Y b' v3 a
End Sub |
|