CAD VBA的块和参照过滤方法

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

共享一下CAD-VBA中,屏幕选择集中对块参照的过滤方法,供参考:'''''''''''''''''''''''''''''''''''''''''''''''''''

Dim melem As AcadEntity

Dim selsetCollection As AcadSelectionSets '定义选择集集合

Dim i,j As Long

Dim ent As Object

' '''''''''''''''''''查找图形中的每个选择集,是否已存在

Set selsetCollection = ThisDrawing.SelectionSets

i = 0

j = 0

For Each FilterSet In selsetCollection

If "xxx" = Then’’’’”xxx”为自己想用的选择集名

j = 1

Exit For

End If

i = i + 1

Next

If j = 0 Then

Set FilterSet = ThisDrawing.SelectionSets.Add("xxx")

Else

FilterSet.Clear

End If

‘’’’’’’定义过滤器数组,设定过滤参数

Dim sFilterType(1) As Integer

Dim sFilterData(1) As Variant

sFilterType(0) = 100

sFilterData(0) = "AcDbBlockReference"

sFilterType(1) = 2

sFilterData(1) = "~ "

FilterSet.SelectOnScreen sFilterType, sFilterData ‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’

另附DXF组码表,以便对上段程式的理解;

DXF下表列出了组码或组码范围以及组码值的解释。在此表中,“固定”表明组码始终具有相同的用途。如果组码不固定,则其用途取决于上下文。关于此表中使用的缩写和格式方面的信息。

相关文档
最新文档