|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。
# S8 O# ?5 a. H9 B1 h9 c5 Q 但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?& Y5 |0 I9 s: c# N2 B
代码如下:
1 _. o- ?% L7 s& ` ]Sub Example_Center()
, Q- S7 R2 h C0 }) M4 E* @ Dim circObj As AcadCircle4 r0 {7 G4 q+ |9 v
Dim currCenterPt(0 To 2) As Double
8 a) u' y! Q( O( o: {+ I3 g% L R Dim newCenterPt(0 To 2) As Double
" `& n" N p. ] Dim radius As Double4 ?* B; f6 c$ J0 r7 l0 D
' Define the initial center point and radius for the circle
9 d5 r0 M# W6 H2 U) n$ a, R currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
4 Y# P0 W/ h I8 u' g; Z! T5 c radius = 3 ! e1 Q, }) \% D! l( O
' Create the circle in model space9 b P7 y1 {9 E6 E
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
0 J. R( o" X* ~- J- m% k7 v# C ZoomAll
% |9 w4 l) }: z- p! Q MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"
' a0 k% b' h& OEnd Sub |
|