|
发表于 2019-5-6 19:37:41
|
显示全部楼层
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))) W* I8 b, z' d& a; F3 d; f$ [
- Sub Example_AddCylinder()+ q# v8 d9 J: V9 J8 h
- ' 此示例在模型空间中创建一个圆柱体。
) W: c5 _( ?+ \8 X( N6 ` - 4 m# D d! d* V5 b; ] A
- Dim CylinderObj As Acad3DSolid
" W2 X J; v$ r, Y$ \9 b' F - Dim Radius As Double: `4 G5 @( j# Z: D. n* H
- Dim Center(0 To 2) As Double
4 \' [4 B: l1 ? - Dim Height As Double9 b2 a) ?5 `) r ^. ?$ s
- ) ~$ O/ r9 e2 r: t6 X
- ' 定义圆柱体 y+ ^! x4 G9 q8 f4 \
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
$ j5 H) b3 u$ R% m - Radius = 5#) B+ K! v4 q: \' l( \8 Z
- Height = 20#
/ O5 S8 ]2 l/ S/ H& X0 _2 J - $ L- \9 m2 P. f2 n! z: ~
- ' 在模型空间中创建圆柱体(3dsolid)对象
; f1 A3 c7 l/ j0 [ - Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)* Q, }5 u. f/ X- W' H+ c+ u- d
- / e) K b, W# m" H
- ' 更改视口的观察方向以更好地查看圆柱体$ N$ X8 g. T) A. m
- Dim NewDirection(0 To 2) As Double
9 `; l3 y* j8 k5 {3 k8 k - NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1! |! h+ Z- ]0 J" _ c. n- Y$ @
- ThisDrawing.ActiveViewport.Direction = NewDirection
8 y1 ~% T1 K/ r4 J- U, V. k - ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
2 I/ t1 v! ?6 W& G% D" J% P - ZoomAll# r5 T" L6 b/ g/ {
- End Sub
复制代码
- X4 m8 | b! W# w$ m2 }8 x% G& ]: {/ h9 {3 l- B! Z/ [1 L" P
( T9 b/ R2 I/ n* @4 j( K. n2 w
|
评分
-
查看全部评分
|