Message 1 of 3
Insert Title Block and border with iLogic code

Not applicable
04-30-2017
11:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All
Im only new to Inventor. I have found a iLogic rule to import the title block from a template but it wont import the border I created in the template also. can someone please help
here it the rule that is working so far.
SyntaxEditor Code Snippet
Sub Main() If ThisApplication.ActiveDocument Is Nothing Or ThisApplication.ActiveDocumentType <> kDrawingDocumentObject Then MsgBox ("Please open a Drawing to work on.") Exit Sub End If 'reference template ThisDrawing.ResourceFileName = "D:\Inventor\AWE Drawing.idw" ThisDrawing.KeepExtraResources = False Dim oDrawingDoc As Inventor.DrawingDocument: oDrawingDoc = ThisApplication.ActiveDocument Dim SheetNumber As Integer 'Clear out the old Titleblocks & Sheetformats For SheetNumber = 1 To oDrawingDoc.Sheets.Count oDrawingDoc.Sheets(SheetNumber).Activate If Not oDrawingDoc.ActiveSheet.TitleBlock Is Nothing Then oDrawingDoc.ActiveSheet.TitleBlock.Delete End If Next SheetNumber 'Delete the previous title blocks as the API does not support replacing Sheet Formats.'DeleteSheetFormatsAll (oDrawingDoc)'DeleteBorders (oDrawingDoc) DeleteTitleBlocks (oDrawingDoc) Dim resu1t As String="Result" Dim T1TLE As New ArrayList T1TLE.Add("AWE Title Block") resu1t=InputListBox("Select Drawing Title Block", T1TLE, resu1t, _ Title := "Title Block", ListName := "Title Blocks from Template") 'Set iProperties based On the selection. If resu1t="AWE Title Block" Then ActiveSheet.TitleBlock = "AWE Title Block" ' 'End If End If End Sub Sub DeleteTitleBlocks(oActiveDoc As Inventor.DrawingDocument) 'Iterate through the collection deleting any titleblocks that are not referenced by the drawing object Dim oTitle As TitleBlockDefinition For Each oTitle In oActiveDoc.TitleBlockDefinitions If oTitle.IsReferenced = False Then oTitle.Delete End If Next End Sub