Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic: How to use GetReferenceKey method

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
j.pavlicek
654 Views, 3 Replies

iLogic: How to use GetReferenceKey method

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



Inventor 2022, Windows 10 Pro
Sorry for bad English.
Labels (1)
3 REPLIES 3
Message 2 of 4
JhoelForshav
in reply to: j.pavlicek

Hi @j.pavlicek 

Try this 🙂

Dim refKey() As Byte = New Byte() {}
oFeature.GetReferenceKey(refKey)
MsgBox(ThisDoc.Document.ReferenceKeyManager.KeyToString(refKey))
Message 3 of 4
j.pavlicek
in reply to: JhoelForshav

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

 



Inventor 2022, Windows 10 Pro
Sorry for bad English.
Message 4 of 4
Hubert_Los
in reply to: JhoelForshav

Hello,

 

How can I use it in VBA?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report