|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。$ @; C1 c/ F) ~( J+ V
但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?
4 e( u) V+ h9 `" z 代码如下:
, _! l: _1 K% q* k/ SSub Example_Center()
* ]8 y9 R% h; m( v$ r) |& L Dim circObj As AcadCircle; z- M% P2 j% ^
Dim currCenterPt(0 To 2) As Double
, H: h, u9 ~1 S2 H) Q9 { Dim newCenterPt(0 To 2) As Double
+ V) g% [+ U" P9 U. J3 N2 x4 |% z Dim radius As Double R# O, F2 {% R2 j. n
' Define the initial center point and radius for the circle2 O1 C; P. i: Y3 |) e, m, [
currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
2 M! _- ?/ A1 I1 C7 p& L/ a radius = 3
/ h% Q2 F0 x' o! {1 k ' Create the circle in model space9 x# M8 E1 W _! q
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)) G" ?: }# Q- z% B
ZoomAll
( w! X3 C4 s( d, m, ^( A& |. m5 O MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"
) N3 x" F! U) n8 c& I! G# @% R, W* kEnd Sub |
|