|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。0 X( Q P+ a* l
但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?
6 ]- g7 M: P3 k! e& ] W 代码如下:' m/ Y {& C% O# [6 Q
Sub Example_Center()# d a7 |9 K1 }# Y3 e- C
Dim circObj As AcadCircle
9 l9 r v7 ^1 h( @# o8 A" Y8 j Dim currCenterPt(0 To 2) As Double: D, }4 F3 ?) d$ f* Z/ |9 f' t6 C
Dim newCenterPt(0 To 2) As Double
, C+ J% y5 [1 V2 y4 l( a Dim radius As Double8 m" R6 R5 A; \/ I2 f' r% g+ W
' Define the initial center point and radius for the circle
) o$ `$ s6 I) Q7 y0 n currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
$ I/ {" P" l* e8 x# ` radius = 3
2 y% y; k# C2 T2 ~; L! i ' Create the circle in model space
# Z1 z) g0 c+ t, t6 S Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
6 l+ K; F$ w2 E) D ZoomAll
* k' K4 F1 }, D7 d: O MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"4 D, M0 s9 E" U: K
End Sub |
|