|
发表于 2019-5-6 19:37:41
|
显示全部楼层
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))
( m4 O4 ~& n& j" v3 o' @$ x- Sub Example_AddCylinder()% X: ]5 B G3 x* @) u
- ' 此示例在模型空间中创建一个圆柱体。$ m$ K) k1 Z( z9 W
-
: J' E* j. n8 m+ p0 a E - Dim CylinderObj As Acad3DSolid0 H& G% e3 c6 X$ Y3 Y
- Dim Radius As Double+ C9 ]0 G& Q6 N! r5 Z* N
- Dim Center(0 To 2) As Double
( ]! s) L3 \. I9 p% _2 F; N - Dim Height As Double! m# ]: Z( I, [' d& c4 W0 S" l! T
- ) E5 s! i9 W4 R8 A, Q) @+ S
- ' 定义圆柱体$ f3 T8 \" B7 _( [- S
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
2 K5 I* @/ Y) U+ H4 K1 C - Radius = 5#0 v2 e+ ]6 J( a% p9 v( E% y0 F. `
- Height = 20#2 Q4 {" ?/ G4 f7 W" L1 o
-
8 Z- q0 _7 j! z) N8 s3 o - ' 在模型空间中创建圆柱体(3dsolid)对象 ?. ^; z; U1 g
- Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)
8 d$ ^+ z$ H8 p& P; a: e6 C6 R -
! h. K% ]' R7 ^ - ' 更改视口的观察方向以更好地查看圆柱体
2 X/ q3 |" B0 \. L2 j6 T& z& e7 w* q/ w - Dim NewDirection(0 To 2) As Double
& q! r6 p2 R' N) m% l' k - NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
. m% l) I. i& q1 t( V5 V1 `- J - ThisDrawing.ActiveViewport.Direction = NewDirection
& p/ `4 c+ y- U* e7 r) V - ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport5 y, t# v/ L( a l( [
- ZoomAll
/ C$ \2 W9 U' B8 Z6 e; @3 N - End Sub
复制代码 9 {' @. a# e$ \6 x7 d y9 Y; d
! T6 E5 s) B( t+ d8 ]: s* A' X. w" n i6 s p- @
|
评分
-
查看全部评分
|