|
|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))
" c+ o8 W8 J0 g- Sub Example_AddCylinder() X+ G! o2 ?* @ P7 c& Q+ ?
- ' 此示例在模型空间中创建一个圆柱体。3 i& y& ` r0 ~. r
-
1 n% q( e w2 e) ^ - Dim CylinderObj As Acad3DSolid
1 S% |7 P- s1 L' x - Dim Radius As Double
1 Z- u" M& Y9 Y - Dim Center(0 To 2) As Double
( l2 f w& j6 U - Dim Height As Double/ W$ [, E2 p5 f% M9 u" D: g
- 9 q% V# E! k, e4 Z" {9 D
- ' 定义圆柱体5 T- V; ~/ L6 W7 Y8 S7 P. f# }
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
7 i# B& E4 {1 O3 {$ s: Z$ h - Radius = 5## b$ a- W G. a: j: ?% k
- Height = 20#
$ R* |( O m: E7 l -
: \5 o- n* s- n) [( |$ x) ` - ' 在模型空间中创建圆柱体(3dsolid)对象0 f E6 Q% S7 Q0 t/ P0 @ S
- Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)
3 ^0 m% u' o6 L N" o0 \( i8 w - $ o8 O L# ?' M/ N# S0 r
- ' 更改视口的观察方向以更好地查看圆柱体7 Q9 m; P$ |9 H8 s/ p8 j
- Dim NewDirection(0 To 2) As Double+ W' [" D" K* j+ k0 Y' Q* Q- ~
- NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1/ m9 l) h) Y! j+ A2 J; a: s
- ThisDrawing.ActiveViewport.Direction = NewDirection! j$ a( N7 @. B6 c0 \" A y# W+ `
- ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
! V% O4 J2 \0 @; W - ZoomAll
D- b& C- E3 Y! i# V: @$ ^! A b - End Sub
复制代码 , M$ j- u0 Y; U% d
( U- D' U5 c9 [# {2 v) w3 F$ Y- q& O5 K5 h: z0 N) k+ }
|
评分
-
查看全部评分
|