|
|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))
@# _' r$ q8 ?. Q1 j, P5 [- Sub Example_AddCylinder()( W4 o" `8 g s0 t, L1 F. d5 P
- ' 此示例在模型空间中创建一个圆柱体。
6 y# S8 Z0 L q - . q |" s8 A6 E: ~1 Q
- Dim CylinderObj As Acad3DSolid1 L4 q4 Z9 u* b9 u. {- w, D* J
- Dim Radius As Double$ E1 \& H0 {" V+ J' _+ |" E
- Dim Center(0 To 2) As Double
2 {- I6 Q5 l8 s" ~( r$ [8 F# `& M - Dim Height As Double
9 \' d2 F+ k4 z9 l; q -
! t5 ]9 R4 Q# ~+ h1 s - ' 定义圆柱体" x2 |! V0 R8 z; ]2 t
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#* A" r, |' z. V& k
- Radius = 5## Y0 K- Y: O6 y- P
- Height = 20#
% u+ B* W- e; J! l( H' B - 2 F" E$ {. ^& ?. G9 Z" d! x( o
- ' 在模型空间中创建圆柱体(3dsolid)对象
7 N' ~" J$ x* q: P7 u& _ - Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)0 R4 S v5 ~* V: Y' R
-
) l; n; {4 X! w! Z - ' 更改视口的观察方向以更好地查看圆柱体( D7 H+ R# O) x. n% T
- Dim NewDirection(0 To 2) As Double1 b* H, |4 L) }/ a) c, L
- NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1 {) g$ s* K$ j, ?3 ` N
- ThisDrawing.ActiveViewport.Direction = NewDirection: D' {9 B3 F \; }+ P' x
- ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport2 F& [4 v/ q2 G, C- Y
- ZoomAll
3 P% R) R" F; @" { - End Sub
复制代码
( l$ J) k- U5 H9 C1 s" U
+ S0 t0 `6 `# k ^) N y1 c- W( }4 @1 I
|
评分
-
查看全部评分
|