|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))
% R- `9 ~4 Q0 R. V4 @. s/ c# x0 x4 \7 p- Sub Example_AddCylinder()
X6 Z% O% ^( X [ - ' 此示例在模型空间中创建一个圆柱体。; {/ {5 F$ ~. E+ Y1 e
-
/ N- }5 z7 p1 Z6 b" I! Z - Dim CylinderObj As Acad3DSolid0 F- ^, x8 x' S2 i) n# {
- Dim Radius As Double
& k: O9 g* Q* r" T" u - Dim Center(0 To 2) As Double; o: C" Y* A% r- h
- Dim Height As Double: n4 {: S( [2 D x' w" Z
-
+ _ R9 [( o- E% I* d$ A - ' 定义圆柱体
! `' x. `3 k6 }. N0 ]4 { - Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
# [ a6 W# z6 C7 f - Radius = 5#; u# q7 Q, s: o" o3 Z+ B
- Height = 20#
2 R3 p( {! K1 \" a$ @( [+ r4 o - % z) l: Y$ {/ D7 U* ?- J0 X( ^" z& K
- ' 在模型空间中创建圆柱体(3dsolid)对象; A! _2 z9 y/ h1 q" T1 v
- Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)) t' Y3 w/ Y! y" u
- - b9 d/ I/ u& \; q4 |% \
- ' 更改视口的观察方向以更好地查看圆柱体
9 n2 i8 C' e8 W" [& i+ }+ j - Dim NewDirection(0 To 2) As Double6 h' X; |+ z- k
- NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
- C; y9 f/ X* f - ThisDrawing.ActiveViewport.Direction = NewDirection
. u$ [: z. Y2 a6 F7 q7 E - ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport( k7 L' W* G# K, J( f) w
- ZoomAll
! K5 @5 v b+ K - End Sub
复制代码 9 p4 e( O" t* k+ @. [ T
) w$ @1 I) c2 b: e T( x/ V
/ ^" d. z* B W Z& W; U |
评分
-
查看全部评分
|