cut & paste in second drawing
HiI have to select all enties in a drawing and paste my selection in a second drawing.
Presently, I found a way to make it, but on a big drawing it's extremely long to execute.There is a faster way to make a cut / paste of a entire drawing in a second..
this is my code.
Dim ssp As AcadSelectionSetSet ssp = ThisDrawing.SelectionSets.Add("TEST_SSET") ssp.Select acSelectionSetAll If ssp.Count = 0 Then Exit Sub Dim DOC1 As AcadDocumentSet DOC1 = Documents.AddDim objCollection() As Object Dim intCount As Integer intCount = ssp.Count - 1 ReDim objCollection(intCount) For i = 0 To intCount Set objCollection(i) = ssp.ITEM(i) Next CurrDoc.CopyObjects objCollection, DOC1.ModelSpace I'm not understanding the non-.NET syntax; that must be VBA? If everything from CurrDoc’s ModelSpace requires copying, would a DOC1.ModelSpace.InsertBlock(…) work?
I’m not sure it would be much faster, necessarily, as the InsertBlock call probably uses a similar method as you've demonstrated.Native code, though, is considerably faster than ActiveX. Whats wrong with Insert ? you can insert an entire dwg in one go into the current dwg no real code needed. Note this is a ALL DWG not a bit of it. If you are indeed copying and pasting everything....and I mean everything, then why not just open the drawing and rename it with a new name. In fact you wouldn't even have to open it. You could also use BIGAL's concept that is to insert the drawing then you could use a different location in the model for the insertion point. I don't mean to over simplify this but if you are wanting everything then why do it piece-meal?
页:
[1]