Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

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