|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))
8 B! \0 |4 {9 I- I! G; f4 V: ]1 I- Sub Example_AddCylinder()
& t1 v0 a7 j/ P/ H. i0 n - ' 此示例在模型空间中创建一个圆柱体。; O- r G" I) T. N8 G) C
- & T6 T6 r6 K! ]6 E: a0 H" j
- Dim CylinderObj As Acad3DSolid, s5 w: [9 x" K& F$ G
- Dim Radius As Double5 @0 j0 m- d+ H7 I* P9 N
- Dim Center(0 To 2) As Double
* v9 S% E+ U2 U- K3 c7 K3 i - Dim Height As Double
3 t F8 b& P; ] - ) n/ W8 z0 [/ F9 A& e+ j8 s
- ' 定义圆柱体, E/ s; Y# G0 \4 m0 h! j6 g
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#& _0 A0 A% z& I3 h
- Radius = 5#
+ o; v4 p0 V* o S9 |+ T3 b - Height = 20#
Y+ N' G$ J; R) w4 U, p0 I1 L - 6 g( w8 F$ Q4 z J( }
- ' 在模型空间中创建圆柱体(3dsolid)对象6 {% f8 X Z' N5 [
- Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)
4 I9 n2 T7 Z% W - ' g, m3 m) j4 x" r; P, u" x
- ' 更改视口的观察方向以更好地查看圆柱体$ _0 I+ E+ ?2 m
- Dim NewDirection(0 To 2) As Double: T; w# G: b9 u# i: G
- NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1. F0 w7 G8 O) }' n
- ThisDrawing.ActiveViewport.Direction = NewDirection( t2 A& U& m. `) B
- ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport6 S- i5 d7 p; {
- ZoomAll
8 y, M" ^0 D& ^; m- C( Y, g' d - End Sub
复制代码
7 B2 X# b" t9 y6 l5 R
) x) E8 m" k* ~* V) `4 m: w1 `; a6 Q9 M! t& Y2 U/ E
|
评分
-
查看全部评分
|