|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。
- V0 z0 R! U$ v7 N- K 但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?
$ F- S7 s5 h8 U; [' Z" {1 C& Y 代码如下:
5 q( a" s3 [+ [3 q3 B( e" FSub Example_Center()5 r' t8 s$ r9 e5 a
Dim circObj As AcadCircle
& w# ~0 N f- x) H' {+ n6 d1 d Dim currCenterPt(0 To 2) As Double8 l/ F3 g, v8 ?& A; X
Dim newCenterPt(0 To 2) As Double: M, C9 v. o, ?* j2 M
Dim radius As Double$ B7 D! u' N6 U# ^
' Define the initial center point and radius for the circle
; k, ]0 \ b" E& }( U9 m: s' u* Y currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0 . m+ z1 o3 }% r L
radius = 3
/ m- h0 k2 I, s& N' S ' Create the circle in model space8 b5 }; y% ~2 J1 K( F R
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
4 m7 {$ d' z! S0 I7 n ZoomAll
0 y1 Z/ @, T% R# a MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"3 y% {* u+ r4 Z4 r; A+ ?
End Sub |
|