哪里错了?文字怎么加入块中
如要想把文字说明和对应的直线封装到一起组成一个块但是文字总是加不进去~~~郁闷,帮忙看看程序哪里有问题?一直抱错~~
Dim ssetObj As AcadSelectionSet<BR> Dim getbiaohao As String<BR> Dim FilterType(5) As Integer<BR> Dim FilterData(5) As Variant<BR> Dim adText As String<BR> Dim adhight As Double<BR> Dim insertionPnt(0 To 2) As Double<BR> Dim blockObj As AcadBlock<BR> Dim temp As Variant<BR> Dim element As AcadEntity<BR> Dim obtext As AcadText<BR> <BR> insertionPnt(0) = 0<BR> insertionPnt(1) = 0<BR> insertionPnt(2) = 0<BR> <BR><BR> Set ssetObj = ThisDrawing.SelectionSets.Add("ssetObj")<BR> <BR> FilterType(0) = -4<BR> FilterData(0) = "<or"<BR> FilterType(1) = 0<BR> FilterData(1) = "Text"<BR> FilterType(2) = 8<BR> FilterData(2) = "0"<BR> FilterType(4) = 0<BR> FilterData(4) = "Polyline"<BR> FilterType(5) = -4<BR> FilterData(5) = "or>"<BR> <BR> ssetObj.SelectOnScreen FilterType, FilterData<BR> For Each element In ssetObj<BR> If element.ObjectName = "AcDbText" Then<BR> temp = element.TextString<BR> adText = temp<BR> temp = element.Height<BR> adhight = temp<BR> Set obtext = blockObj.AddText(adText, insertionPnt, adhight)<BR> ElseIf element.ObjectName = "AcDbPolyline" Then<BR> temp = element.Coordinates<BR> blockObj.AddPolyline (temp)<BR> End If<BR> Next 你的块在哪里? ssetObj.SelectOnScreen FilterType, FilterData<BR> Set blockObj = ThisDrawing.Blocks.Add(insertionPnt, "CircleBlock")<BR> <BR> For Each element In ssetObj<BR> If element.ObjectName = "AcDbText" Then<BR> temp = element.TextString<BR> adText = temp<BR> temp = element.Height<BR> adhight = temp<BR> Set obtext = blockObj.AddText(adText, insertionPnt, adhight)<BR> ElseIf element.ObjectName = "AcDbPolyline" Then<BR> temp = element.Coordinates<BR> blockObj.AddPolyline (temp)<BR> End If<BR> Next
少给了一句,不好意思,删多余对话框的时候,不小心删掉了 直接用CopyObjects方法试试
页:
[1]