|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。* p+ T1 d" L( n* x
但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?
4 _6 L5 N G1 E 代码如下:
2 ]1 _" b% I5 q; L# A- R- ]3 PSub Example_Center()* R( m9 ?' s% w
Dim circObj As AcadCircle
! k% j% q8 }. f' d) ~3 N Dim currCenterPt(0 To 2) As Double! m$ A' t R( r/ A' j
Dim newCenterPt(0 To 2) As Double; X. \/ v4 |, {% C4 C0 S
Dim radius As Double+ `" d- h. f' H% i3 J
' Define the initial center point and radius for the circle
% W6 u- c4 u' X, z* I currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
& R5 V# Q4 w' J: W/ W' H* a" Y! t radius = 3 0 E% L& M) U) Q' G5 R, {6 ?3 Q
' Create the circle in model space4 x1 B" d7 x$ t/ V5 N+ z
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
, K! z7 u8 k* F+ L, @ }! _ ZoomAll
( [( ^' }' h6 D: \$ ~' x* c! ~ MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"( b# f$ ^# q) g9 y" Z
End Sub |
|