yusicad 发表于 2007-7-23 15:03:00

求助:块选择过滤问题

<p>On Error Resume Next<br/>&nbsp; Dim FilterSets As AcadSelectionSet<br/>&nbsp; If Not IsNull(FilterSets.Item("BlockRef")) Then<br/>&nbsp;&nbsp;&nbsp;&nbsp; Set FilterSets = ThisDrawing.SelectionSets.Item("BlockRef")<br/>&nbsp;&nbsp;&nbsp;&nbsp; FilterSets.Delete<br/>&nbsp; End If<br/>&nbsp; Set FilterSets = ThisDrawing.SelectionSets.Add("BlockRef")<br/>&nbsp; '创建过滤机制<br/>&nbsp;&nbsp;&nbsp; Dim fType(0) As Integer<br/>&nbsp;&nbsp;&nbsp; Dim fData(0) As Variant<br/>&nbsp;&nbsp;&nbsp; fType(0) = 0<br/>&nbsp;&nbsp;&nbsp; fData(0) = "BlockRef"<br/>&nbsp;&nbsp;&nbsp; '提示用户选择<br/>&nbsp;&nbsp;&nbsp; FilterSets.SelectOnScreen fType, fData</p><p>这是我设定的在屏幕上选取块的过滤条件,可是为什么选不中块呢,总是提示显示0个对象,请高手指教!谢谢</p>

yusicad 发表于 2007-7-23 15:56:00

<p>fData(0) = "BlockRef"<br/>问题主要出在这,谁能告诉我这个参数怎么设置吗?</p><p></p>

lh869 发表于 2007-7-23 22:05:00

<p>&nbsp; Dim blockRefObj As AcadBlockReference<br/>&nbsp; Dim Sall As AcadSelectionSet<br/>&nbsp; Dim FilterType(0) As Integer<br/>&nbsp; Dim FilterData(0) As Variant<br/>&nbsp; Dim InsertionPnt(0 To 2) As Double<br/>&nbsp; FilterType(0) = 0<br/>&nbsp; FilterData(0) = "insert"</p><p></p><p>&nbsp;&nbsp;&nbsp; '''''开始构造选择集<br/>&nbsp;&nbsp;&nbsp;&nbsp; Set Sall = acadDoc.SelectionSets.Add("SS1")<br/>&nbsp;&nbsp;&nbsp;&nbsp; Sall.Select acSelectionSetAll, , , FilterType, FilterData&nbsp;&nbsp;&nbsp; ''''''找出选择集中的块属性</p><p></p><p></p><p>''''''具体操作过程</p><p></p><p></p><p>&nbsp;&nbsp;&nbsp;&nbsp; Sall.Delete&nbsp; ''''''释放选择集</p><p></p><p></p>

yusicad 发表于 2007-7-24 10:04:00

<p>哈哈果然可以,牛人,谢谢,问题解决了,打死我也想不到会是"insert"</p>

mufeng 发表于 2007-7-25 09:58:00

<p>噢,我也找怎么过滤只选择块,谢谢</p>
页: [1]
查看完整版本: 求助:块选择过滤问题