求助:为什么看不到创建的块??
程序如下:
Sub Example_Add() ' 创建一新块,名称为"New_Block" 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, "*N") MsgBox blockObj.Name & " has been added." & vbCrLf & _ "Origin: " & blockObj.Origin(0) & ", " & blockObj.Origin(1) _ & ", " & blockObj.Origin(2), , "Add Example"
' 在块中创建圆. Dim circleObj As AcadCircle Dim centerPoint(0 To 2) As Double Dim radius As Double ' 定义圆 centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0# radius = 100# ' 添加圆到块中 Set circleObj = blockObj.AddCircle(centerPoint, radius) Set blockObj = Nothing
End Sub 请指教 |