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

Here's a usage example from an addin written by myself & @MrSmithtastic:

 

Private Sub m_UserInputEvents_OnActivateCommand(CommandName As String, Context As NameValueMap)
            If Not AddinGlobal.InventorApp.ActiveDocument Is Nothing Then
                If (AddinGlobal.InventorApp.ActiveDocument.DocumentType = DocumentTypeEnum.kDrawingDocumentObject) Then
                    If CommandName = "VaultCheckinTop" Or CommandName = "VaultCheckin" Then
                        DocumentToPulliPropValuesFrom = AddinGlobal.InventorApp.ActiveDocument
                        If iProperties.GetorSetStandardiProperty(AddinGlobal.InventorApp.ActiveDocument, PropertiesForDesignTrackingPropertiesEnum.kDrawingDeferUpdateDesignTrackingProperties, "", "") = False Then
                            WhatToDo = MsgBox("Updates are not Deferred, do you want to Defer them?", vbYesNo, "Deferred Checker")
                            If WhatToDo = vbYes Then
                                AddinGlobal.InventorApp.ActiveDocument.DrawingSettings.DeferUpdates = True
                                myiPropsForm.Label8.ForeColor = Drawing.Color.Red
                                myiPropsForm.Label8.Text = "Drawing Updates Deferred"
                                UpdateStatusBar("Updates are now Deferred")
                                MsgBox("Updates are now Deferred, continue Checkin", vbOKOnly, "Deferred Checker")
                            Else
                                'Do Nothing
                            End If
                        End If
                    End If
                End If
            End If
        End Sub

^ doesn't deal with setting up the Events listener or anything, but if you want to dig into it a little deeper, then the repo is here:

 

https://github.com/AlexFielder/MyFirstInventorAddin