|
发表于 2019-5-6 19:37:41
|
显示全部楼层
来自: 中国北京
以下内容译自 AutoCAD 帮助>资源>开发人员文档>ActiveX: Reference Guide(ActiveX:参考指南)>Methods(方法)>AddCylinder Method (ActiveX)(AddCylinder方法(ActiveX))4 V+ I" @" c, x: y( |) e. P8 @
- Sub Example_AddCylinder()7 Y( m9 W6 N, A' v
- ' 此示例在模型空间中创建一个圆柱体。
* F1 J5 }4 T8 F+ e# { -
# F t# u2 P$ h$ I' U) F" A/ z t - Dim CylinderObj As Acad3DSolid% ~- y, a9 Y9 N" [5 p% L% F
- Dim Radius As Double
7 |/ f4 Q, x2 V0 p2 u2 ^6 h$ t: n - Dim Center(0 To 2) As Double
( w' J/ s/ U: E9 i: b1 H2 X' d* \ - Dim Height As Double
( R& _7 E7 r7 n -
! @. i+ f2 |; K3 m3 g7 N' H2 B - ' 定义圆柱体* d9 h" P0 p; R, H# I- G+ u
- Center(0) = 0#: Center(1) = 0#: Center(2) = 0#
# |" ]4 M; O: Y; N - Radius = 5#' S8 x. y7 |/ v& h
- Height = 20#
: x) P, o" W# z. ]7 M- G- F0 e5 S; } - 8 V. D0 u* x5 d
- ' 在模型空间中创建圆柱体(3dsolid)对象 S% o1 ^ E+ _' e3 k* w* H% a* m
- Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(Center, Radius, Height)7 K: O8 b, W, A2 k0 ^
-
7 G+ m# Y0 j; L, V! t - ' 更改视口的观察方向以更好地查看圆柱体- x9 _7 q2 K. t. x% f0 s- h- d
- Dim NewDirection(0 To 2) As Double
% a$ t! {5 ~* A% _* o& [ - NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
* F) O( z1 P2 a* T7 c: y - ThisDrawing.ActiveViewport.Direction = NewDirection+ T4 r: J- R9 Z! @9 l" K
- ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport) ~# S1 p1 n9 }
- ZoomAll
3 `; z1 a# q4 U T - End Sub
复制代码 2 G# L* o7 W+ t$ O! H# b* s
, S* Z+ T- W" U* t* M1 \
% _9 K& R- x2 s |
评分
-
查看全部评分
|