Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I run the following code in Inventor 2023, the message box returns the correct string that represents the reference key of the line selected. However, when the same code is ran in Inventor 2025 it returns "AA==", no matter what is selected. Does anyone know how to fix this?
Dim oAsm As Document = ThisApplication.ActiveDocument oObject = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchCurveFilter, "Select a line to link length to - Press Esc to cancel") If IsNothing(oObject) Then Exit Sub End If ' Set a reference to the ReferenceKeyManager object. Dim refKeyMgr As ReferenceKeyManager refKeyMgr = oAsm.ReferenceKeyManager ' Get reference keys from the selected entities. Dim refKey(0) As Byte oObject.GetReferenceKey(refKey) ' Convert the reference keys to strings to make saving it easier. Dim strKey As String strKey = oAsm.ReferenceKeyManager.KeyToString(refKey) MessageBox.Show(strKey, "Title")
Solved! Go to Solution.