|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。
" \) J2 A2 q; T# v# }$ t \ 但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因? I! B w3 q7 u ~
代码如下:
& ~4 G' K" p$ U2 m# iSub Example_Center()1 G0 p. d9 o. E. g! h( O/ T
Dim circObj As AcadCircle
# ^0 w5 z; [) [" H5 z7 Z Dim currCenterPt(0 To 2) As Double
& S1 M/ r* B- k0 U6 ~3 P5 O Dim newCenterPt(0 To 2) As Double
! t. Z! f& A! m! ? Dim radius As Double9 ~% F8 n& }- {
' Define the initial center point and radius for the circle
1 w6 ^0 c- {- C0 h; [0 t currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
" G+ t* X ] o# O' r" `+ ~ radius = 3 8 _8 d' q( P3 c% k) m' U* S1 M
' Create the circle in model space% F3 O( R- ~5 G
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
' |* j6 c# F5 o ZoomAll
7 G$ _9 ]. p) D& ^+ w! y1 R% J MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"
" k& n1 p# r2 V8 f v9 UEnd Sub |
|