|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
请教一下大家,我在CAD中移动了坐标原点(用UCS命令),手动画圆输入圆心坐标它是相对我UCS为0,0原点的这没错。
5 G( L% A% z) v, ^7 N, b, s 但是用VBA画圆时,它的圆心以最初的绝对坐标来画,这是什么原因?
\) U4 l! ^# O 代码如下:/ A8 e" i% n; X, H3 _
Sub Example_Center()7 k7 K4 O* _4 l9 S
Dim circObj As AcadCircle6 E; a1 e+ c% l; }0 O4 D
Dim currCenterPt(0 To 2) As Double1 a0 J' C- U" a5 n% a% {% ?
Dim newCenterPt(0 To 2) As Double
" z8 \4 ^* a/ r ^4 `6 s Dim radius As Double
) Z4 F3 A* i$ v2 Q9 t2 S ' Define the initial center point and radius for the circle
' y: j+ x! y7 L8 ?4 q$ R X currCenterPt(0) = 20: currCenterPt(1) = 30: currCenterPt(2) = 0
% \4 i& o6 @4 q radius = 3
8 _1 b; Q1 R( I: U ' Create the circle in model space
" _" [4 W/ \% n0 h6 \7 v+ G Set circObj = ThisDrawing.ModelSpace.AddCircle(currCenterPt, radius) Y/ _1 B! M& ^8 i( ~7 J, J
ZoomAll7 Y" s H4 v8 U( `
MsgBox "The center point of the circle is " & currCenterPt(0) & ", " & currCenterPt(1) & ", " & currCenterPt(2), vbInformation, "Center 示例"
6 f0 ~' L- {% P! D4 ~) BEnd Sub |
|