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

 


Dim modelDoc = ThisDrawing.ModelDocument
Dim drawingViewExtension As String = System.IO.Path.GetExtension(modelDoc.FullFileName).ToLower()

' 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"

' Assign the appropriate title block based on the file extension
Dim titleBlockName As String = defaultTitleBlock ' Default title block

Select Case drawingViewExtension
    Case ".ipt"
        titleBlockName = titleBlockIPT
    Case ".iam"
        titleBlockName = titleBlockIAM   
End Select

' Set the title block for the active sheet
ActiveSheet.TitleBlock = titleBlockName