06-21-2023
04:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-21-2023
04:31 PM
Hi @BK-MTFNE,
Give this a try.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
' Define the title block names Dim titleBlockIPT As String = "Production Drawing Title Block" Dim titleBlockIAM As String = "Assembly Drawing Title Block" Dim defaultTitleBlock As String = "DefaultTitleBlock" Dim drawingViewExtension As String Dim drawingView As DrawingView oCurrentSheet = ThisDoc.Document.ActiveSheet For Each oSheet In ThisDoc.Document.Sheets oSheet.activate drawingViewExtension = "" oViewCount = ThisDoc.Document.ActiveSheet.DrawingViews.count If oViewCount > 0 Then drawingView = ThisDoc.Document.ActiveSheet.DrawingViews.Item(1) modelDoc = ActiveSheet.View(drawingView.Name).ModelDocument If Not modelDoc Is Nothing Then drawingViewExtension = System.IO.Path.GetExtension(modelDoc.FullFileName).ToLower() End If End If Select Case drawingViewExtension Case ".ipt" titleBlockName = titleBlockIPT Case ".iam" titleBlockName = titleBlockIAM Case Else titleBlockName = defaultTitleBlock End Select ' Set the title block for the active sheet ActiveSheet.TitleBlock = titleBlockName Next oCurrentSheet.activate