块的基本定义
VBA class name: |
AcadBlock |
Create using: |
Blocks.Add |
Access via: |
Blocks.Item Layout.Block |
一般的使用方法见后面程序所述,主要语句是用的Block.add方法,代表语句是Set circleObj = blockObj.AddCircle(center, radius)。
我的问题是经过Boolean处理的实体如何添加块中.
boxObj.Boolean acIntersection, cylinderObj
可以写成set box = boxObj.Boolean acIntersection, cylinderObj
得到box.objectID,或box.handle, box.name,我试了好多次都不能通过。
从block帮助文件中,objectID,HANDLE,Name是block的属性,用什么办法可以将经过boolean处理过的实体添加到定义块中,谢谢。
以下是块定义常用的方法
' 定义块 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.AddCircle(center, radius)
|