|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。2 _% `: z( q6 Y# n& Q. b
但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?, ~( o F$ e6 h+ {
代码如下:
8 y0 L: ^( D p& USub Example_Center()6 y/ X3 C# J. ^# W5 F
Dim circObj As AcadCircle/ Y; S; ?% W' z1 D; @ g
Dim currCenterPt(0 To 2) As Double
3 K% u3 ` T1 W* u. t/ I. w- y7 r; h Dim newCenterPt(0 To 2) As Double g8 ` r. o' o) m! R# G2 O
Dim radius As Double# r# P* C( J4 ]/ ]
' Define the initial center point and radius for the circle( y# y" T! p) V+ u2 [- t
currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
# X" D" ]/ `/ ?3 V; ~8 T3 c radius = 3
/ U; T+ ^5 y1 p ' Create the circle in model space" L! E4 f& S, k, b- t* p3 [
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
2 G6 f2 p' l4 i6 A/ B) y5 d5 `4 E ZoomAll
/ y X4 u) V! N- f0 L$ a; q. i0 q MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"0 }0 B* U8 O5 S' H
End Sub |
|