|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。
- N6 b1 m) V [( Z" k 但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?0 A0 r) F$ f7 |/ q
代码如下:
, V0 N, a' M( c6 T8 t5 Y/ oSub Example_Center()
+ V0 K H7 P: y2 v( l. i- ` Dim circObj As AcadCircle
4 L3 E+ U t& ~! ~ Dim currCenterPt(0 To 2) As Double
y: ^4 n% G- U; w2 R, a; `+ G Dim newCenterPt(0 To 2) As Double
+ a5 J( }1 W8 I1 w: S Dim radius As Double
. G# D G, S6 S1 U) a ' Define the initial center point and radius for the circle
9 T O' b* w" T8 e7 U7 I9 M currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
& p$ I: H5 A1 J3 j8 E) U$ H! z radius = 3 " d; h# \( ?; u0 E+ v: C
' Create the circle in model space7 j0 S: m! i5 t, @
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)( u e6 @6 [9 r
ZoomAll
N, c' K# ~. [9 J: x" R. c6 ~ MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"
4 ?( V# ^ W) v- r8 OEnd Sub |
|