|
发表于 2019-5-6 19:37:41
|
显示全部楼层
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))
( L7 n% f1 ]+ G( L4 A- Sub Example_AddCylinder()# C# T$ c! O: \
- ' 此示例在模型空间中创建一个圆柱体。
+ ~8 z( t& N- T' D: s& X - 5 Q) b6 J u4 P: f) c! l4 i6 |
- Dim CylinderObj As Acad3DSolid
' [+ r4 p( _; ?$ b5 V, V - Dim Radius As Double
3 V! c8 Q" B" W) [) w) w - Dim Center(0 To 2) As Double* h; B/ s1 w7 A6 B) z
- Dim Height As Double1 n+ Z0 n7 v E4 t) w9 R
- ! a+ Q4 v$ [% Y: f) |7 ?$ [
- ' 定义圆柱体/ H) O: a3 D! I2 H* r8 `
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
3 ]4 J8 E% q+ C7 b; f. H - Radius = 5#
' B( M: e! b4 c! C4 P - Height = 20#' A% p1 `8 C5 q! L! R4 T9 j0 Y
- " U& r+ h! Q" [ G; ?& L6 w
- ' 在模型空间中创建圆柱体(3dsolid)对象- g0 p! |$ G. k' a) Q
- Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)9 i0 g6 v) X/ T% x
- & S( ]2 V2 j- e5 E+ J# W! K
- ' 更改视口的观察方向以更好地查看圆柱体6 ~8 t! w. i$ q
- Dim NewDirection(0 To 2) As Double
0 U% U# ^3 L# w, ]# M8 h5 O( S4 M - NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 10 Q0 A9 [: H2 s7 y
- ThisDrawing.ActiveViewport.Direction = NewDirection# c8 Z1 Y+ C* B( i9 y
- ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport5 L p1 Z& m- q) B6 ?3 ]5 {
- ZoomAll/ e" `4 N- P, t5 z3 `7 |
- End Sub
复制代码 - t) j, S; b) @6 a
; e7 _- \ R4 ]1 W: i. V! U4 [
% u Z. ?, S3 P, ^ |
评分
-
查看全部评分
|