|
|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))
. u0 X0 r: ^ \3 C! K1 n- Sub Example_AddCylinder()
" m# E4 ]% r& o2 v- z - ' 此示例在模型空间中创建一个圆柱体。
2 {4 U7 O( @" H2 @' e - ' [. h- e _6 P
- Dim CylinderObj As Acad3DSolid4 d1 {& R6 v( m# X2 c' P0 L, Q
- Dim Radius As Double
) j" T9 ] K. E/ `3 f/ s) q# W/ N/ O - Dim Center(0 To 2) As Double; i9 H# A9 r* u r1 x
- Dim Height As Double
9 a# q6 J. G3 M) T3 B -
3 ]4 L+ r! u ?" o) l2 | - ' 定义圆柱体" Z6 h9 J c% s0 r2 b
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
* _. v6 c. g0 b1 _( D2 t9 v - Radius = 5#
( j) \6 R) v9 D" n4 l; R; J, ` - Height = 20#0 w- E% D# f* M! Q- g
- 2 @$ P+ \7 }" S( [
- ' 在模型空间中创建圆柱体(3dsolid)对象: b( \! E+ v7 b
- Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)
8 o- | Z, a2 [ - 1 I0 b) c" U9 r) g5 b9 B) x
- ' 更改视口的观察方向以更好地查看圆柱体( N1 U* o$ J; c) \5 h. c7 N
- Dim NewDirection(0 To 2) As Double
, u2 o: y6 ?" O - NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
h) T0 }' K! Q) v8 U - ThisDrawing.ActiveViewport.Direction = NewDirection
. ?; S, }7 x( k5 v - ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
+ Q9 i7 R4 V7 j3 I' V" S; { ` - ZoomAll7 U" ]5 _- f. Y: G$ I
- End Sub
复制代码
! T0 R( X5 d5 c3 s7 I1 N! e3 \# v! K
* g5 {5 Y3 a( s7 O$ E" C7 j: {% M |
评分
-
查看全部评分
|