|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。
5 L: I2 C5 W2 b6 Z/ P7 x) M4 C7 l 但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?
8 r8 D4 y [6 p8 R 代码如下:
+ P' b( _7 s+ h' pSub Example_Center()% |" n' l- ?& s/ A8 P
Dim circObj As AcadCircle
/ [& c- q4 S, }4 K5 T2 S# l/ a Dim currCenterPt(0 To 2) As Double ?+ Y" d' G& s7 R; h1 Q
Dim newCenterPt(0 To 2) As Double
f7 x: o/ v- i6 L- E7 P. ` Dim radius As Double
' [) G5 J8 D" a2 T* G: c' d! A ' Define the initial center point and radius for the circle
" c! j \2 C* c currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0 ) w/ Y/ k6 u* k* G4 y
radius = 3
% G V4 v# C6 m7 E& u) k5 C ' Create the circle in model space- L8 E5 U6 F4 E! r, E( x0 k+ M
Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
, T4 ^+ O+ |$ k3 { ZoomAll
# y8 l; k# K5 |& n2 N9 b MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"
+ z: z9 B- @( ^- w2 ?& MEnd Sub |
|