- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all.
I've got a variety of scripts that act upon entities of a known location within model-space (or paperspace, or within blocks). These are currently selected through an iteration in code similar to this:
For Each AcadEnt In ThisDrawing.ModelSpace
If TypeOf AcadEnt Is AcadTable Then
Set SelTable = AcadEnt
If SelTable.InsertionPoint(0) = -1000 And SelTable.InsertionPoint(1) = -1000 Then
...
'Do stuff here
Exit For
...
End If
End If
Next AcadEnt
This is acceptable on smaller drawings, but its inefficiently becomes evident on bigger ones as it's looping through the whole modelspace dataset.
I've tried using selection-sets, however these only appear to work in the current space. A lot of this sort of code is executed from paperspace (and sometimes also using object dbx), and I'd prefer not to flip into modelspace or work through viewports.
Is there a more efficient way of selecting an entity if it's parameters are known?
cheers
G
Solved! Go to Solution.