|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。 d! A- P% Z& B$ w2 K
但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?& d- r( c* X: F g- `) o; A
代码如下:3 M1 _; d% @& o
Sub Example_Center()
. n* Z4 \. i$ n" G$ h- x9 O Dim circObj As AcadCircle
* j0 V- G( @2 y6 i4 t/ A Dim currCenterPt(0 To 2) As Double+ s) f) u5 u9 |( | x) u( Y
Dim newCenterPt(0 To 2) As Double
9 q& J! G) |- }' C% R Dim radius As Double
( g$ V8 K2 f- _9 \ ' Define the initial center point and radius for the circle# u5 K/ a/ X& M% k8 a5 b6 f0 M8 ]
currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0 5 v& T7 O8 R& P/ N8 h
radius = 3
4 `+ B! O& a- q6 W/ S ' Create the circle in model space
- j' C$ x' W8 i/ M2 [ Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
6 c& U: }" i6 @4 S6 F0 g8 J; `! @ ZoomAll, M0 L% Q: m2 e- d% ?
MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"
# \' k% L9 a2 @& U X. _# G0 WEnd Sub |
|