|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。
# }5 a! x7 O) Z0 Q 但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?
, g& ?# c8 \- O+ {* ] 代码如下:
$ \% J+ o; M1 u# E# g; c. xSub Example_Center()( v# t: p' v, _ J: _
Dim circObj As AcadCircle
3 f' {4 V3 v( _% _/ a Dim currCenterPt(0 To 2) As Double
: `& J$ f7 s# j# R | V/ v; Q Dim newCenterPt(0 To 2) As Double
8 e, ~7 a# x! `3 c Dim radius As Double
) E6 Y! M! n/ G ' Define the initial center point and radius for the circle
. o/ F- Z& S* @ currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0 8 n8 f3 u$ E/ x, ]8 N
radius = 3 ' n+ z; F" m" T Q) R8 g# ?) }
' Create the circle in model space
" l! W, d$ N- q$ k, U |& D* b Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius)
b# F- N: K _ ZoomAll
3 G" Q& r$ B1 q+ v; p" g) n* K* Z MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"9 j' I: }; Q9 a8 @4 D$ p
End Sub |
|