zxfzxf 发表于 2005-9-9 16:31:00

求助:为什么看不到创建的块??

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

alin 发表于 2005-9-9 20:43:00

<P>还没有插入呢,那是一个无名块</P>
页: [1]
查看完整版本: 求助:为什么看不到创建的块??