Hi @dusan.naus.trz
I wrote this simple CopyBlocks sub for you.
First argument is the document to copy the blocks from.
Second argument is the document to copy the blocks to.
Third argument is the name of the block you want to copy. If you don't enter anything here all blocks will be copied.
See example below 🙂
Sub Main
'Document to copy from
Dim oDoc As PartDocument = ThisApplication.Documents.Open("C:\Temp\CopyBlocks\ROWS.ipt", False)
'Call sub - if you add a name as third argument then only that block will be copied, otherwise every block will be copied
CopyBlocks(oDoc, ThisDoc.Document, "ROWS_poz_01")
End Sub
Sub CopyBlocks(fromDoc As Document, toDoc As Document, Optional oName As String = "")
If oName <> ""
fromDoc.ComponentDefinition.SketchBlockDefinitions.Item(oName).CopyTo(toDoc)
Else
For Each oBlock As SketchBlockDefinition In fromDoc.ComponentDefinition.SketchBlockDefinitions
oBlock.CopyTo(toDoc)
Next
End If
End Sub