
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello people. Its good to be back after a month of daily programming.
I have made a professional application for autocad from ground up. It achieves the aims of sorting crossections of roads.
The only problem with the code is inside one routine which has to take the empty graph in a drawing and make multiple copies of it. The code is attached in the attachment.
For some reason, the routine takes almost more than 4 minutes to finish. There are almost 1600 objects that it has to copy and move for about ten times.
My question is, Is there a way to move the graph as a single object. As in, all the objects in the graph behaving as one object?
Any help would be greatly appreciated. N.B I have had quite a lot of fun developing the app, although Im an electronics engineer 😄
acDoc.Editor.WriteMessage(vbLf & "This is time to select the main graph window") Dim graphprompt As PromptSelectionResult graphprompt = acDocEd.GetSelection If graphprompt.Status = PromptStatus.OK Then Dim Graph = graphprompt.Value Dim graphobjidcoll = New ObjectIdCollection(Graph.GetObjectIds()) Dim count1 Dim x1 = 210 For count1 = 0 To graphsneeded For Each graphobjid As ObjectId In graphobjidcoll Dim obj As DBObject = trans.GetObject(graphobjid, OpenMode.ForRead) Dim objclone As Entity objclone = obj.Clone() objclone.SetDatabaseDefaults() objclone.TransformBy(Matrix3d.Displacement(New Vector3d(x1, 0, 0))) acBlkTblRec.AppendEntity(objclone) trans.AddNewlyCreatedDBObject(objclone, True) db.TransactionManager.QueueForGraphicsFlush() obj.Dispose() Next x1 = x1 + 210 Next graphobjidcoll.Clear() End If
Solved! Go to Solution.