Ok, im struggling a little here, I think I have all the right functions under my hat but cant seem to string them together, what im trying to achieve is replacing all the blocks in one drawing with all the blocks of the same name in another drawing.
so the process im going through is:
1. Open up the 2 drawings and match up the block names - done
2. Create a new database and add the blocks from the source drawing that matched the final drawing - stuck
3. copy the blocks from the new database into the final drawing - this should be easy once ive got part 2 done.
Any help please?
Below is the example of where I got to but I get an error stating the block is already in the database
Dim ThisDrawing As Document = Application.DocumentManager.Open(SourceLoca.Text, True)
Dim ThisDB As Database = ThisDrawing.Database
Dim Trans As Transaction = ThisDB.TransactionManager.StartTransaction
Dim BT As BlockTable = Trans.GetObject(ThisDB.BlockTableId, OpenMode.ForRead)
Dim BTenum As SymbolTableEnumerator = BT.GetEnumerator
Dim TempDB As Database = New Database(True, True)
Do While BTenum.MoveNext = True
Dim BTR As BlockTableRecord = BTenum.Current.GetObject(OpenMode.ForRead)
MsgBox("new database done")