Hi @A.Acheson I'm attempting to do something similar to @j_weberarnold-it_com but copying multiple sheet formats from one drawing to another. The problem is that some of these sheet formats use the same title blocks as each other, so when they are copied into the new drawing, they create multiple copies of the title blocks in the Title Blocks folder ("Titleblock1', "copy of Titleblock1" etc.) These copies cannot be deleted because they are being referenced by the sheet format.
When manually copying the sheet formats, I get a prompt to select "Replace" or "New" when a duplicate title block is being copied over.
In my iLogic code, at the "SheetFormat.CopyTo([destination file])" I have seen it written in other code with a switch: "SheetFormat.CopyTo([destination file], True)" In my testing, it behaves the same with our without the ", True" switch as both the lack of switch and using "True" seems to use the default of creating a "New" instance of the title block.
Is there another switch I can use in the CopyTo() command to "Replace" the title block instead of creating new ones?
Dim oDoc As DrawingDocument = ThisDoc.Document
'Specify the Drawing Template document to copy from
Dim oNewTBDef As TitleBlockDefinition
Dim oNewSFDef As SheetFormat
Dim oTFN As String = "C:\...\Standard.idw"
Dim oTemplate As DrawingDocument = ThisApplication.Documents.Open(oTFN, False)
'Copy all Sheet Formats from Template to this drawing.
Dim oTemSFDefs As SheetFormats = oTemplate.SheetFormats
For Each oTemSFDef As SheetFormat In oTemSFDefs
oNewSFDef = oTemSFDef.CopyTo(oDoc)
Next
Thanks for any help to this iLogic newbie!