acdbblockreference问题
本帖最后由 作者 于 2004-12-8 17:54:10 编辑 <br /><br /> 用vb6.0,2004cad lib库;Dim acadapp As AcadApplication<BR>Dim acaddoc As AcadDocument
Set acadapp = GetObject(, "autocad.application.16")
acadapp.Documents.Open (filepath) '打开dwg文件<BR> Set acaddoc = acadapp.ActiveDocument<BR> acadapp.Visible = False
For ind = 0 To acaddoc.ModelSpace.Count - 1'循环读取<BR> <BR> Set ent = acaddoc.ModelSpace.Item(ind)<BR> If ent.ObjectName = "AcDbBlockReference" Then<BR> <BR> Set blockRefObj = ent<BR> <BR> If UCase(blockRefObj.Name) = "TBZ10" or UCase(blockRefObj.Name) = "TBF00" And blockRefObj.HasAttributes = True Then<BR> '取内容,略过
end if
next
此遍历的方式太慢(要查询所有的object),如何能直接查询到块TBZ10(或它的blockreference),使速度加快。一个200k的dwg要一分多钟 用选择集+过滤器 怎么定义和使用,我还真不知道,能写代码吗
页:
[1]