Message 1 of 5
Which would be preferred and why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've coded the following to obtain a list of layouts within open drawings. The purpose is to obtain a full list of layout object ids so I can use them later. I was wondering which would be best to use considering there will be 50ish drawings each with 5 layouts. By 'best' I mean 'most efficient' and 'best practice'.
Alternatively is there an even better way to obtain a list of layout object ids???
Dim qDLs As IEnumerable(Of ObjectId) = _ From ll In acBlkTbl _ Let f = CType(ll.GetObject(OpenMode.ForRead), BlockTableRecord) _ Where f.IsLayout = True And f.Name <> "*MODEL_SPACE" Select ObjID = f.LayoutId Dim DwgLayoutIds1 = qDLs.ToList()
And;
Dim DwgLayoutIds2 As New ObjectIdCollection For Each BlkTblRecId As ObjectId In acBlkTbl Dim BlkTablRec As BlockTableRecord = acTrans.GetObject(BlkTblRecId, OpenMode.ForRead) If BlkTablRec.IsLayout And BlkTablRec.Name <> "*MODEL_SPACE" Then DwgLayoutIds2.Add(BlkTablRec.LayoutId)
End If Next
(Apologies for the code formatting)