|
|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))7 P5 F5 O. E5 ], L
- Sub Example_AddCylinder()
- r* S. r8 j/ r2 ` - ' 此示例在模型空间中创建一个圆柱体。5 W( Z- g+ k7 ]: y0 I
- 4 r. W0 I6 e i8 T; c) b3 W0 ~+ x
- Dim CylinderObj As Acad3DSolid/ U* U, P& v! k
- Dim Radius As Double
! [# ^2 R7 B A& l7 d6 X8 F - Dim Center(0 To 2) As Double
, m) R6 p; J6 G( h% f V$ o/ l - Dim Height As Double
3 g9 V+ I, } L) Z -
. z! O9 @( `# ~8 o* t. h2 [ - ' 定义圆柱体
! f- y' G5 f: f" o' Q - Center(0) = 0#: Center(1) = 0#: Center(2) = 0#6 ]+ A% ^- l- y% T. Q6 v) x' i
- Radius = 5#
" ?# F( H+ ^3 |8 _5 Y - Height = 20#
9 {, ^; U- @8 b; V -
1 Z" v+ ^2 U/ W& f3 Z - ' 在模型空间中创建圆柱体(3dsolid)对象
% h) k4 A1 p! D* f8 a& g - Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)
' j" Z4 t' ^0 y. |$ X* U- A7 u - $ v! ]# ^/ y6 C- @+ p7 }/ D' f4 L
- ' 更改视口的观察方向以更好地查看圆柱体
, C8 h/ f( W! j; u# y - Dim NewDirection(0 To 2) As Double
- B/ }5 A9 T: t - NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1& S4 ?, O% N6 d* O. i
- ThisDrawing.ActiveViewport.Direction = NewDirection
7 T, \5 v- Y- }9 `$ T - ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
( J# ~% J U A* f, C - ZoomAll
. D3 T2 L% q; x9 b - End Sub
复制代码 9 z) J6 h) }8 ~" M- p
' }. N' J: G4 N W
0 I6 R. ?; `! J0 h9 I |
评分
-
查看全部评分
|