- 积分
- 24557
- 明经币
- 个
- 注册时间
- 2004-3-17
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-6-3 21:04:00
|
显示全部楼层
Public Sub test() Dim pBlocks(1) As AcadBlock Dim myBlock As AcadBlock Dim pnt(2) As Double Dim p1(2) As Double, p2(2) As Double Dim obj(1) As AcadBlockReference Set pBlocks(0) = ThisDrawing.Blocks.Add(pnt, "*U") Set pBlocks(1) = ThisDrawing.Blocks.Add(pnt, "*U") p2(1) = 10 pBlocks(0).AddLine p1, p2 p1(0) = 10 pBlocks(0).AddLine p1, p2 p2(1) = 20 pBlocks(1).AddLine p1, p2 p1(0) = 20 pBlocks(1).AddLine p1, p2 Set obj(0) = ThisDrawing.ModelSpace.InsertBlock(ThisDrawing.Utility.GetPoint, pBlocks(0).Name, 1, 1, 1, 0) Set obj(1) = ThisDrawing.ModelSpace.InsertBlock(ThisDrawing.Utility.GetPoint, pBlocks(1).Name, 1, 1, 1, 0) Set myBlock = ThisDrawing.Blocks.Add(pnt, "*U") myBlock.InsertBlock obj(0).InsertionPoint, pBlocks(0).Name, 1, 1, 1, 0 myBlock.InsertBlock obj(1).InsertionPoint, pBlocks(1).Name, 1, 1, 1, 0 ThisDrawing.ModelSpace.InsertBlock pnt, myBlock.Name, 1, 1, 1, 0 obj(0).Delete obj(1).Delete
End Sub
|
|