Hello, my question is ovious:
How to use PartFeature.GetReferenceKey Method?
I tried:
Dim refKey() As Byte oFeature.GetReferenceKey(refKey)
But Type Mismath. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)) error was thrown.
System.Runtime.InteropServices.COMException (0x80020005): Type Mismath. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.CircularPatternFeature.GetReferenceKey(Byte[]& ReferenceKey, Int32 KeyContext)
at ThisRule.Main()
I have no idea what to do.
Thanks for help
Solved! Go to Solution.
Solved by JhoelForshav. Go to Solution.
Hi @j.pavlicek
Try this 🙂
Dim refKey() As Byte = New Byte() {} oFeature.GetReferenceKey(refKey) MsgBox(ThisDoc.Document.ReferenceKeyManager.KeyToString(refKey))
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website
Thanks. You are right. Array is object in VB.net, so it has to be created.
Dim arr() As Byte 'arr = Nothing, but ready to accept an existing Array of Bytes Dim arr() As Byte = New Byte() {} 'Creates a new (and blank) Array of Bytes and assign it to arr
Can't find what you're looking for? Ask the community or share your knowledge.