Hi, I'm writing the code that copies cells multiple times.The simplified example code below. It copies selected element 10 times.
Sub copySelectedElement() Dim el As Element, ee As ElementEnumerator, newEl As Element, mr As ModelReference Dim offset As Point3d Set mr = ActiveModelReference Set ee = mr.GetSelectedElements If ee.MoveNext Then Set el = ee.Current Else Exit Sub End If For i = 1 To 10 offset.X = i Set newEl = mr.CopyElement(el) newEl.Move offset newEl.Rewrite Next End Sub
I find this code super slow, as the lines 13 and 15 in the code make the changes in the model that are seen on the screen which I think slows down the whole code. Is there a way to do same thing without showing each step on the screen and just update model view in the end of the code?