- 积分
- 210
- 明经币
- 个
- 注册时间
- 2010-7-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2010-12-28 08:24:23
|
显示全部楼层
Sub Ch10_InsertingABlock()
' 定义块
Dim blockObj As AcadBlock
Dim insertionPnt(0 To 2) As Double
insertionPnt(0) = 0
insertionPnt(1) = 0
insertionPnt(2) = 0
Set blockObj = ThisDrawing.Blocks.Add (insertionPnt, "CircleBlock")
' 向块中添加圆
Dim circleObj As AcadCircle
Dim center(0 To 2) As Double
Dim radius As Double
center(0) = 0
center(1) = 0
center(2) = 0
radius = 1
Set circleObj = blockObj.Set circleObj = blockObj.AddCircle(center, radius)
'获取插入点
Dim returnPnt As Variant
returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point: ")
' 插入块
Dim blockRefObj As AcadBlockReference
Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock (returnPnt, "CircleBlock", 1#, 1#, 1#, 0)
ZoomAll
End Sub |
|