Message 1 of 5
Speed problem with modifying properties of multiple dynamic blocks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Would there be a faster way of doing the following?
I have a an event that updates dynamic properties of potentialy hundreds blocks. I'm a bit surprised at how slow it is considering that if I filter and change the colors of the same blocks it is instantaneous.
Sub ModifyViewDimensions(ByVal trans As Transaction) For Each ObjID In tmpIDCollection ProgressBar("Updating Views", tmpIDCollection.Count, False) Dim br As BlockReference = DirectCast(trans.GetObject(ObjID, OpenMode.ForWrite), BlockReference) Dim pc As DynamicBlockReferencePropertyCollection = br.DynamicBlockReferencePropertyCollection For i = 0 To pc.Count - 1 Dim prop As DynamicBlockReferenceProperty = pc(i) If prop.PropertyName = "A" Then prop.Value = A If prop.PropertyName = "B" Then prop.Value = B If prop.PropertyName = "C" Then prop.Value = C If prop.PropertyName = "D" Then prop.Value = D If prop.PropertyName = "E" Then prop.Value = E_ Next br.Dispose() pc.Dispose() Next ProgressBar("Updating Views", tmpIDCollection.Count, True) End Sub
I use a main transaction and pass that transaction through all my subroutines. There is something also after the procedure that also causes a long delay. I assume the drawing regen but there is no way to add a progress bar to that.
Performed on 60 blocks it takes 15 seconds to make the updates then there's a 20 second stall for the drawing to update.
Hope someone can help.