|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。
8 z5 F1 b5 d+ x 但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?8 l! H; B7 S9 V5 ] k) x
代码如下:
! z( Q( w0 s9 v' M& SSub Example_Center()
0 Y( u- [0 s, V Dim circObj As AcadCircle! X* p+ l$ j* j, k
Dim currCenterPt(0 To 2) As Double* P. X$ J8 y! m. l$ Y9 ]) O
Dim newCenterPt(0 To 2) As Double
% O/ f! \ I* V1 u' d Dim radius As Double) h$ C j2 N% u
' Define the initial center point and radius for the circle
% o% W& [3 V6 R- p" U9 X' d currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
+ w @! A9 q7 Y5 B( t. g( v radius = 3 ! G: ]1 i+ ]* D
' Create the circle in model space; Q2 D( w2 h- h; k2 K- @
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
7 o6 C9 A: z% r2 p2 D ZoomAll
- b3 r- I% v; E- M$ ?+ P' k MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例" C6 O3 k: l5 d2 L% [) }
End Sub |
|