谁有遍历块中及相嵌块中每一实体的代码
谁有遍历块中及相嵌块中每一实体的代码,谢谢! Sub Test(BlockName As String)Dim a As AcadBlock
Set a = ThisDrawing.Blocks(BlockName)
For Each i In a
Debug.Print i.EntityName
Next i
End Sub 块里又有块,至少10层,该怎样遍历? Sub Test(BlockName As String)
Dim a As AcadBlock
Set a = ThisDrawing.Blocks(BlockName)
For Each i In a
Debug.Print i.EntityName
If i.EntityName = "AcDbBlockReference" Then Test i.Name
Next i
End Sub 谢谢,兄弟,什么时候来天津我请客! 对于多级相同的处理,使用递归算法比较合适。
EntityName在R2000之后的版本使用ObjetName代替,但仍然保留着,变成了隐含的属性,所以最好不要使用,而且ObjectName意思更贴切。
页:
[1]