不知道你想要什么,但如果你评论出来,如果没有(aLayout。ModelType ),然后在它前面添加一个',并注释掉相应的结尾,如果您将获得每个块引用,
如果您只想要模型空间中的块,请使用我提供给您的内容,或者替换“如果没有(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
|