|
|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))* f/ ~: h! m2 L
- Sub Example_AddCylinder()
& |$ U- w3 W$ l: F+ k( M( t - ' 此示例在模型空间中创建一个圆柱体。. G! H: v& h- o4 B3 z
-
B# |- q8 w5 E - Dim CylinderObj As Acad3DSolid* R5 Q5 f, P$ b) \
- Dim Radius As Double+ m' L5 a T% `# V; O$ _
- Dim Center(0 To 2) As Double' F1 Z, C) ~2 ^4 G
- Dim Height As Double% F' P& D/ N: q f
-
5 D: c8 M- u2 W - ' 定义圆柱体
: {. x5 s2 R0 Q* n! H - Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
$ h4 x8 I4 Q0 b - Radius = 5#" d5 u, i1 o9 B( _
- Height = 20#) L2 j5 [% f, o0 ~" x' H% h
- ) I. h# E. H1 o9 ^
- ' 在模型空间中创建圆柱体(3dsolid)对象( E, @* Q' b9 P: a
- Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)0 c9 e, E1 n3 ~3 Q1 @9 A' G0 ^
- % }8 q6 R9 P- ?
- ' 更改视口的观察方向以更好地查看圆柱体( _! a, i- P! Y& E
- Dim NewDirection(0 To 2) As Double, q- Z0 R% m/ d4 M8 ^ Q
- NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1( J# {$ @5 F1 `: x
- ThisDrawing.ActiveViewport.Direction = NewDirection
; q. v8 }, O3 x( l$ C% J( ] - ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
) ?% t8 H. q, l. K+ l0 _8 P- [% s - ZoomAll, s" I, A$ ?" ?! k- b7 `
- End Sub
复制代码
" C9 J4 a( Y/ O7 E( e# G! m8 [9 S1 r8 x" H8 A, ?! d8 `/ @' z
( f1 W' Y( V- }2 ~$ u, m |
评分
-
查看全部评分
|