如果您只想要模型空间中的块,请使用我提供给您的内容,或者替换“如果没有(aLayout。ModelType),然后“如果布局,则使用
。型号然后
If Not (aLayout.ModelType) Then
For Each aEntity In aLayout.Block 'Loop thru all entities
'If the current entity is a block insertion
If TypeOf aEntity Is AcadBlockReference Then
Set aBlkRef = aEntity 'Cast the entity into a block ref
'If the block insertion has attributes
If aBlkRef.HasAttributes Then
'Use a procedure to add block to dictionary
'Need procedure for isolated error handling
AddBlock BlockStore, aBlkRef.Name, aBlkRef.GetAttributes
End If
End If
Next aEntity
End If
好吧bryco,如果你阅读上面的帖子,我现在还有一个问题。基本上我从建筑物的一个角落开始,然后将我的块镜像到另一边。这镜像了属性,所以我使用了一个交换值的例程,唯一的问题是它没有也交换标签。现在我需要交换标签以使这种方法工作,或者也许不是寻找标签,而是可以在块内寻找数值,因为所有的工作表名称都是数字的。有什么建议吗? 看看上面的文件,我正在交换一些可能有帮助的属性值(和字符串内容)。
P. S. Bryco对此知道的比我多得多 使用一些lisp来重新插入错误的插入,测试isnumeric来判断哪个标签是哪个标签。在我看来,你需要花一点时间学习vba,因为你已经在这方面做了很多编程。这看起来比lisp简单多了。但是你的程序太复杂了,在不了解整个程序的情况下,很难快速修复。
页:
1
[2]