|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))
$ W6 o" L( P) h% b- Sub Example_AddCylinder()9 W# m1 g& E! R* s* q; s8 c
- ' 此示例在模型空间中创建一个圆柱体。
! ^. I1 _& s1 g - " @: c ]1 ~- d' m+ h
- Dim CylinderObj As Acad3DSolid
6 v0 w4 O$ o. O0 M+ {# v1 t - Dim Radius As Double2 B4 j: x+ B, I" p1 W" M
- Dim Center(0 To 2) As Double b! M: Y! y8 d; K! B5 s
- Dim Height As Double1 A3 }5 p5 ~' p
-
' v. e- {/ g; `5 Z! Y - ' 定义圆柱体# r3 B+ O& Q+ A, X! [7 v0 S2 d6 R
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
0 H( h- r i: z$ B: X1 P1 ] - Radius = 5#9 C6 J5 `4 {+ X3 P% {% @; A6 M
- Height = 20#
; a2 V! V/ q6 @+ \' I$ Z - % N- Y/ e: [# O5 _% r
- ' 在模型空间中创建圆柱体(3dsolid)对象 H9 R# E: e- M) J, i8 p) q
- Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)4 J$ g* G0 p4 ?
- ' q4 m: }3 W& H8 R* ?' [
- ' 更改视口的观察方向以更好地查看圆柱体
7 A/ g5 \! b" C1 D - Dim NewDirection(0 To 2) As Double
7 B9 l7 A5 b1 w - NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1- q( s# F* A! }8 E) A' S7 ~
- ThisDrawing.ActiveViewport.Direction = NewDirection
8 k. j% x q3 q5 g! G9 R2 k& d0 G - ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport. Y/ O/ C z7 F+ b, s9 g7 t
- ZoomAll
7 J% Q5 v& f+ P - End Sub
复制代码
( Y, V1 d' f$ G: m0 w0 f! E
' X! Z/ ^; q; s1 g" k4 \) d j) a4 J2 K) g$ ?0 U- L& U/ N
|
评分
-
查看全部评分
|