|
|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))1 ]; T$ I2 ]6 Z+ R6 E$ d
- Sub Example_AddCylinder()
* k) N, O, O% s; R. i& c1 T2 W$ b - ' 此示例在模型空间中创建一个圆柱体。. B0 U8 ~; L, Q3 R( x+ r! R1 t$ H
-
9 B1 R C- J; h6 p0 ` - Dim CylinderObj As Acad3DSolid
: `1 K! `& C8 Q; M0 r - Dim Radius As Double8 B% f4 R( I* E# {, `) M
- Dim Center(0 To 2) As Double
, ^4 X# ], J! K3 b% }) ]$ F - Dim Height As Double
* Y/ v: l) ]" T3 _" ?& {0 |$ E$ d - 9 ^( f* S. W3 d" O# |; _8 G# I
- ' 定义圆柱体6 A" n" w# K7 y# O1 K' J
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
* b" L0 p+ M0 |4 _6 |9 E - Radius = 5#
7 [8 M; z) d4 |7 F; B W - Height = 20#
! S, I2 @: Z0 u _9 v/ O, F" L - + \# x( h y8 E5 Z( |5 c* }
- ' 在模型空间中创建圆柱体(3dsolid)对象
. J- Y B9 x4 @: \" t/ G9 w9 b - Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)0 K B6 ~6 g% X7 [7 E( c) {
-
5 y. u. a! A0 u. }# ^ - ' 更改视口的观察方向以更好地查看圆柱体! J& ]# o% p v2 ]# D; l
- Dim NewDirection(0 To 2) As Double; Q" e- O) y* Z- N' j
- NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1. ~& `; f3 L A- I/ p5 ?; a& n
- ThisDrawing.ActiveViewport.Direction = NewDirection
' K' k, [. \5 L# K* q - ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport6 U. o# u3 c7 I. ]& k. n: h
- ZoomAll# P6 V! K# n" m& `# c& v
- End Sub
复制代码 / u" C8 }& l5 v
# @7 |& m1 R( x5 K: p2 ~9 X
! f5 Z+ e* g- Q |
评分
-
查看全部评分
|