|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。2 {$ O9 u. F6 s4 X) l2 `
但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?
b/ l. u& X: ?; B, u 代码如下:) g* Y$ o4 u5 F& |
Sub Example_Center()
0 K& |6 a) `" q7 O5 H4 u3 W+ ? Dim circObj As AcadCircle
, m, C6 M, S: d0 z& L* J2 ` Dim currCenterPt(0 To 2) As Double
6 G. k& d7 j3 Y9 O Dim newCenterPt(0 To 2) As Double
+ U9 D! B7 b; g6 u2 P/ ~ b! J Dim radius As Double
, |5 {# V0 R" w/ E; Q ' Define the initial center point and radius for the circle
+ p4 d% D: K: l( H) \ currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
( c$ s8 t) G1 x7 Y* \5 D: N radius = 3
~0 I0 e% G5 K ' Create the circle in model space
/ v! ~0 D r0 \* v Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
- i6 d! F9 c/ T, B- x0 N$ Q3 k1 g ZoomAll' }, D3 }" c! M- n. N. H6 \; H" @+ F
MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"/ ^, b$ W5 h; M( e
End Sub |
|