OnPopulateFileMetadata - which command trigged the event

OnPopulateFileMetadata - which command trigged the event

stefan.palm
Advocate Advocate
553 Views
3 Replies
Message 1 of 4

OnPopulateFileMetadata - which command trigged the event

stefan.palm
Advocate
Advocate

Would it be possible to, via the OnPopulateFileMetadata event arguments, figure out which command triggered the event?

 

Thanks

 

0 Likes
Accepted solutions (1)
554 Views
3 Replies
Replies (3)
Message 2 of 4

bradeneuropeArthur
Mentor
Mentor

Hi,

Don't know if that is possible.

I will have a look.

I am using the userinputevents to trigger the command name first.

Then I use the populatefilemetadata event....

 

Maybe this already helps you?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 3 of 4

stefan.palm
Advocate
Advocate
Accepted solution

Thanks for quick reply.

I found what i needed --> CommandManager.ActiveCommand.

0 Likes
Message 4 of 4

antoniobaron
Contributor
Contributor

This info is for Addin development hope its useful even if it's a little bit late.

 

 

 

Public Sub Active()

 

m_FileUIEvents = m_inventorApplication.FileUIEvents

 

' replace meventsobj by the inventor 

AddHandler m_inventorApplication.FileUIEvents.OnPopulateFileMetadata, AddressOf m_fileUIEvents_OnPopulateFileMetadata

 

Public Sub m_fileUIEvents_OnPopulateFileMetadata(ByVal FileMetadataObjects As Inventor.ObjectsEnumerator, ByVal Formulae As String, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_FileUIEvents.OnPopulateFileMetadata

HandlingCode = HandlingCodeEnum.kEventHandled

MsgBox("Testing 1 2 3")

Dim oMetaData As FileMetadata
If FileMetadataObjects.Count > 0 Then
For Each oMetaData In FileMetadataObjects
'suggest custom name
oMetaData.FileName = "asdk_" & oMetaData.FileName
oMetaData.FileNameOverridden = True

Next oMetaData
'tell Inventor the event is handled
HandlingCode = HandlingCodeEnum.kEventHandled
End If

End Sub

 

https://spiderinnet2.typepad.com/blog/2013/03/inventor-api-vbnet-fileui-events.html

0 Likes