|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。
5 w0 E* l) X# X5 a- U: k 但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?
3 m- q8 M+ [3 a1 O. t 代码如下:- r; X9 Q: G, K" Z+ L7 r# P
Sub Example_Center()' [$ |9 E/ n6 O; o
Dim circObj As AcadCircle
8 {3 Y4 q& `3 r4 r7 z' } Dim currCenterPt(0 To 2) As Double
) E% M4 U, d( F Dim newCenterPt(0 To 2) As Double
. C" t3 C; I9 m: q' c Dim radius As Double
# ~) _5 y8 e& }2 }, r& z ' Define the initial center point and radius for the circle7 ?3 M) H5 b5 B$ r
currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
1 W1 a; T; Q5 C5 C/ [6 D* c radius = 3
) M6 W: r2 {& ] ' Create the circle in model space
* q& @% t9 @1 Z, S# I Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
6 X7 s3 f. p9 E# E { ZoomAll
+ |+ z/ q3 i+ V$ e5 d# i' V MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"7 a& T) E8 F6 _& u* m
End Sub |
|