|
发表于 2019-5-6 19:37:41
|
显示全部楼层
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))
4 w5 [' [6 ^! C3 j1 E- Sub Example_AddCylinder()
$ [) _: ~3 H$ c; V& F0 [ - ' 此示例在模型空间中创建一个圆柱体。4 H: `- g4 M; [8 F7 y
- , f |, g2 v z. j
- Dim CylinderObj As Acad3DSolid
8 t4 Q: f; V8 x - Dim Radius As Double8 ]% q9 c X+ B7 b, B2 N
- Dim Center(0 To 2) As Double, O5 m# o! W1 C/ Q" V% q
- Dim Height As Double
8 I" f, m4 @5 u& C2 G5 p - e) [9 A+ @' J' Y) \* k
- ' 定义圆柱体& `# `# j& [, h) h0 M
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
" r- M$ \8 i6 c' }1 M+ z - Radius = 5#4 O. Z: K0 z b; m( u
- Height = 20## s* p$ K% i" V/ \
- * v! W3 x* z/ {( z9 t5 g) ]
- ' 在模型空间中创建圆柱体(3dsolid)对象
7 A2 P! f1 X9 Y! R - Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)7 t0 \+ X4 I! d. [& a. _7 O2 w7 B; w
-
. T: w2 m/ a3 r {7 k, ]' Q) ^8 p& d - ' 更改视口的观察方向以更好地查看圆柱体0 F" }5 j( G+ }& N- Y
- Dim NewDirection(0 To 2) As Double% M- o$ H$ m+ z3 v$ l% j5 t8 h
- NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1$ p7 N( v( T0 T1 R
- ThisDrawing.ActiveViewport.Direction = NewDirection, F- Q! L: u6 e8 c% X7 T
- ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport. G9 F' I+ P2 U! L
- ZoomAll) L3 y# ]& G6 n' Q7 L9 _' w. k7 C. e
- End Sub
复制代码
( \5 W+ [+ z. {, r; l
$ u; W" @6 `9 K y- C# j1 S# D1 o2 e. x. Z7 g
|
评分
-
查看全部评分
|