OnFileResolution event

OnFileResolution event

marin_israel
Enthusiast Enthusiast
707 Views
4 Replies
Message 1 of 5

OnFileResolution event

marin_israel
Enthusiast
Enthusiast

Hi, I need to resolve link with onfileresolution event

 

I have exactly this problem:
https://modthemachine.typepad.com/my_weblog/2015/08/modified-parameters-of-event-handler-ignored.htm...

 

However, the solution only works on my computer. When I deploy my addin on other computers, it does not work anymore. The event is raised but the action inside is ignored.

 

Thank you for guiding me to find a solution.
* I can provide other information as needed.

-------------------------------------
Israël Marin
Programmeur | Programmer
Logiflex
0 Likes
Accepted solutions (1)
708 Views
4 Replies
Replies (4)
Message 2 of 5

chandra.shekar.g
Autodesk Support
Autodesk Support

@marin_israel,

 

Can you please provide non confidential source code and steps to reproduce the behavior? Please also mention Inventor version and windows operating system.

 

After Inventor 2019, support Apprentice x86 is withdrawn. So, apprentice always work with x64. For more details, you can refer below forum discussion link.

 

https://forums.autodesk.com/t5/inventor-customization/apprenticeservercomponent-open-inventor-2019-f...

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 3 of 5

marin_israel
Enthusiast
Enthusiast

@chandra.shekar.g 

My code is already in x64 and it's not with the apprentice server.

It's an AddIn for Inventor 2018.

 

I created an addin with the minimum to recreate the problem.

See attach files.

 

When I put a breakpoint in the function, the program stops at the breakpoint. But, even if the "FullFileName" is good: the link is not resolved.

 

Thank you for the support!

-------------------------------------
Israël Marin
Programmeur | Programmer
Logiflex
0 Likes
Message 4 of 5

MjDeck
Autodesk
Autodesk
Accepted solution

@marin_israel , are all the computers running Inventor 2018.3? If not, I'd recommend changing the reference to Autodesk.Inventor.Interop.dll in the project to 22.0.0.0. As it is, you have it at 22.3.0.0.
But that doesn't sound like the problem you're seeing.
I tested your add-in (with the reference version change to 22.0.0.0) on two systems: one running Inventor 2019 and one running 2018.3. The file resolution worked on both.
Here's something to try:
Set 

HandlingCode = HandlingCodeEnum.kEventNotHandled

as the first line in your event handler. That will make it the default return value. That's the recommended practice for most Inventor event handlers.

On the machines that don't work, it could be that other add-ins are also handling the OnFileResolution event. Are there any differences that you can see between the machines?

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 5 of 5

marin_israel
Enthusiast
Enthusiast

@MjDeck 

I've changed the reference to 22.0.0.0. I understand the problem that could cause when I deploy my addin.

 

I've tried to set HandlingCode = HandlingCodeEnum.kEventNotHandled at the beginning of the event and set 

HandlingCode = HandlingCodeEnum.kEventHandled just when I resolve de file.

 

It seems to solve my problem.

Thank you for your help!


-------------------------------------
Israël Marin
Programmeur | Programmer
Logiflex