放弃410路线...它不起作用...即使是Lisp。
我建议循环每个布局的实体,这样,如果您遇到您的块,您可以立即知道它在哪个布局上...或者...为块创建过滤的选择集,循环选择集并检查块参照的所有者,这样可以确定它是否属于布局。
这里还有一个。通过只查看图纸空间,可以减少选择集中要查看的位置的数量。
下面是一个示例:
- Public Sub GrabPaperBlkRefs()
- Dim iDxfCode(0 To 2) As Integer
- Dim vDxfCodeVals(0 To 2) As Variant
- Dim pSelSet As AcadSelectionSet
-
- iDxfCode(0) = 0: vDxfCodeVals(0) = "INSERT"
- iDxfCode(1) = 2: vDxfCodeVals(1) = "YourBlockNameGoesHere"
- iDxfCode(2) = 67: vDxfCodeVals(2) = 1 ' Paperspace
-
- Set pSelSet = ThisDrawing.PickfirstSelectionSet
-
- pSelSet.Select acSelectionSetAll, , , iDxfCode, vDxfCodeVals
-
- MsgBox "Block references found: " & pSelSet.Count, vbInformation, "Block Reference Count"
- End Sub
干杯,
格伦。 |