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

Hi,

 

This Code is working, but need to investigate the titleblock add function.

This seems to be a bug in inventor.

        Dim a As Inventor.Application
        a = _InvApp

        Dim b As DrawingDocument
        b = a.ActiveDocument

        Dim sh As Sheet
        sh = b.ActiveSheet

        Dim shts As Sheets
        shts = b.Sheets

        Dim newsh As Sheet
        newsh = shts.Add

        Dim bo As BorderDefinition
        bo = b.BorderDefinitions.Item(2)' REPLACE WITH THE NAME OF THE BORDER YOU NEED

        Dim He As TitleBlockDefinition
        He = b.TitleBlockDefinitions.Item(1)' REPLACE WITH THE NAME OF THE TITLEBLOC YOU NEED


        newsh.Activate()
        Call newsh.AddBorder(bo)
 
        newsh.Activate()
        Dim titlebl As Inventor.TitleBlock

        titlebl = newsh.AddTitleBlock(He)


    End Sub

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !