Hi
I need to run a method after a drawing has completely opened. When a drawing opens, it takes a little bit of time to load the requirements, then you see the page appear and then finally, everything loads. (this can vary per drawing). Is there a method that gets called when the drawing has completely opened?
Thanks
Nacho
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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 !
Run the "After Open" event trigger and add in a timed delay?
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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 !
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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 !
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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 !
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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 !
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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 !
Hi
would you mind posting an example if you have the time? My code looks right but nothing happens at all. No errors, no function
Cheers
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Hi,
Please find the Application Add In event:
Imports Inventor Imports System.Runtime.InteropServices Imports Microsoft.Win32 Namespace InventorAddIn2 <ProgIdAttribute("InventorAddIn2.StandardAddInServer"), _ GuidAttribute("78ee7c88-8b32-4af9-801b-3d2925c7b66c")> _ Public Class StandardAddInServer Implements Inventor.ApplicationAddInServer ' Inventor application object. Private m_inventorApplication As Inventor.Application Private m_ClientID As String 'Application events Private WithEvents m_inventorApplicationEvents As ApplicationEvents #Region "ApplicationAddInServer Members" Public ReadOnly Property InventorApplication As Inventor.Application Get Return m_inventorApplication End Get End Property Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate ' This method is called by Inventor when it loads the AddIn. ' The AddInSiteObject provides access to the Inventor Application object. ' The FirstTime flag indicates if the AddIn is loaded for the first time. ' Initialize AddIn members. m_inventorApplication = addInSiteObject.Application m_ClientID = AddInGuid(GetType(StandardAddInServer)) m_inventorApplicationEvents = m_inventorApplication.ApplicationEvents ' TODO: Add ApplicationAddInServer.Activate implementation. ' e.g. event initialization, command creation etc. SetupUserInterface(addInSiteObject, firstTime, m_ClientID) End Sub Public Sub Deactivate() Implements Inventor.ApplicationAddInServer.Deactivate ' This method is called by Inventor when the AddIn is unloaded. ' The AddIn will be unloaded either manually by the user or ' when the Inventor session is terminated. ' TODO: Add ApplicationAddInServer.Deactivate implementation ' Release objects. Marshal.ReleaseComObject(m_inventorApplication) m_inventorApplication = Nothing System.GC.WaitForPendingFinalizers() System.GC.Collect() End Sub Public ReadOnly Property Automation() As Object Implements Inventor.ApplicationAddInServer.Automation ' This property is provided to allow the AddIn to expose an API ' of its own to other programs. Typically, this would be done by ' implementing the AddIn's API interface in a class and returning ' that class object through this property. Get Return Nothing End Get End Property Public Sub ExecuteCommand(ByVal commandID As Integer) Implements Inventor.ApplicationAddInServer.ExecuteCommand ' Note:this method is now obsolete, you should use the ' ControlDefinition functionality for implementing commands. End Sub #End Region Public Shared ReadOnly Property AddInGuid(ByVal t As Type) As String Get Dim guid As String = "" Try Dim customAttributes() As Object = t.GetCustomAttributes(GetType(GuidAttribute), False) Dim guidAttribute As GuidAttribute = CType(customAttributes(0), GuidAttribute) guid = "{" + guidAttribute.Value.ToString() + "}" Finally AddInGuid = guid End Try End Get End Property Public Sub SetupUserInterface(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean, ClientID As String) End Sub Private Sub m_inventorApplicationEvents_OnSaveDocument(DocumentObject As _Document, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum) Handles m_inventorApplicationEvents.OnSaveDocument If BeforeOrAfter = EventTimingEnum.kBefore Then MsgBox("before") End If If BeforeOrAfter = EventTimingEnum.kAfter Then MsgBox("after") End If End Sub End Class End Namespace
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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 !
Can't find what you're looking for? Ask the community or share your knowledge.