|
|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))9 T% K7 x) q( l$ j
- Sub Example_AddCylinder(): e" m+ h7 E( Y! R4 Y, P
- ' 此示例在模型空间中创建一个圆柱体。6 Q3 Q/ y, x% i
- 0 s1 c' N" v' e' ]- I$ ?% R/ M
- Dim CylinderObj As Acad3DSolid2 }- {" f$ R7 m$ o) @
- Dim Radius As Double
: e: C. r8 k/ } - Dim Center(0 To 2) As Double! r% O2 d( L, |
- Dim Height As Double
9 J: O9 c) K, q2 U& M& { -
3 r2 h6 X8 T v& F1 A' C b - ' 定义圆柱体" v" L4 [1 S' q3 o. ?! V0 Y
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#% G: k; J8 G8 Y7 f$ b: b
- Radius = 5#, [! m. z3 F/ X" s0 y6 A
- Height = 20#
$ j! j8 o% C! J# n% E -
/ T5 i0 B3 y& X) @ - ' 在模型空间中创建圆柱体(3dsolid)对象/ _0 U' `5 M) U
- Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)
7 v3 Z8 ^8 n9 U/ |1 i5 o8 T# u# @ -
# I! W( q, ?5 {1 P - ' 更改视口的观察方向以更好地查看圆柱体
) W1 I" E4 ~* }8 J" j$ ] - Dim NewDirection(0 To 2) As Double
, {5 w, D5 w* @% A* p3 E; A - NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
" I2 U" n. M* E' K5 t' U - ThisDrawing.ActiveViewport.Direction = NewDirection
7 Y' I1 l& s8 h% X+ b+ s+ M9 @$ _ - ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
6 P2 W; b$ p( K! R - ZoomAll7 n) |* Q3 W+ M% d) @6 j
- End Sub
复制代码 : e8 ?5 O" o# S1 h& W
+ T! l6 R+ t1 f, f r }) X9 P b
8 ]: L! I/ ]- S6 S' m9 T+ R* V6 n |
评分
-
查看全部评分
|