|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。* O5 M5 s- R$ `* f: M N
但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?; `9 b8 t. R$ H+ j- J) d
代码如下:
3 u0 G7 Q% W5 j' J, J! XSub Example_Center()! G+ W' x7 O. f' F. Z, t- G: C
Dim circObj As AcadCircle5 A2 w- H8 _+ ?2 X% }
Dim currCenterPt(0 To 2) As Double; b( a. u$ w4 r3 L2 A3 I
Dim newCenterPt(0 To 2) As Double! d4 L3 l( P3 G4 r% z& t
Dim radius As Double' C% @1 e+ b. B2 `1 n9 D5 q
' Define the initial center point and radius for the circle, T3 k! ]) E- W! b+ m
currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
/ `4 I/ D# f+ V radius = 3
+ G9 o3 ~; G6 T Z ' Create the circle in model space6 \' D, v4 f% s8 m6 G; e
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)2 U! s5 q( s8 N W' ]
ZoomAll/ j! h, v# c% ^" \! z7 G
MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"
W; M. ~8 I2 U5 M0 i' @End Sub |
|