Help! Unable to reactivate Vault add-in with iLogic?

Help! Unable to reactivate Vault add-in with iLogic?

eduane
Contributor Contributor
205 Views
1 Reply
Message 1 of 2

Help! Unable to reactivate Vault add-in with iLogic?

eduane
Contributor
Contributor

Hello all,

 

This is driving me nuts and I'm hoping someone can help me get to the bottom of this:

 

I need to suppress check-out dialog temporarily while some other code runs.  I have been doing this successfully for some time now using the following code:

Dim oVault As ApplicationAddIn = ThisApplication.ApplicationAddIns.ItemById("{48B682BC-42E6-4953-84C5-3D253B52E77A}")
oVault.Deactivate

'other code...

oVault.Activate

This was working perfectly up until about a week or two ago. Nothing has changed that I'm aware of, but all of a sudden I get this error every time it tries to run the activate command after the deactivate command has run:

 

"The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"

 

Here is what it says under the "More Info" tab:

 

"System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.ApplicationAddIn.Activate()
at ThisRule.Main() in rule: Activate Vault, in document MyDoc.ipt:line 11
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)"

 

To make things even weirder, it randomly will work every now and then - most of the time it works if I've just restarted the computer and usually only works once if at all. Also, I'm the ONLY person having this issue, my coworkers can use the same iLogic rule just fine with no errors. This leads me to believe it's probably computer specific?

 

If I run the code with the activate portion commented out (so it only deactivates), I can't even manually reactivate vault - either nothing happens or inventor just straight up crashes if I click anything in the Vault browser tab. Also, attempting to manually load the Vault addin back in with the Addin Manager does nothing. The Addin Manager also says it is still loaded even after running the deactivate command, but I know it is deactivated because I will get errors saying I'm not logged into Vault if I try to check something in for instance.

 

 

Any help or direction will be greatly appreciated.

 

 

0 Likes
206 Views
1 Reply
Reply (1)
Message 2 of 2

JMGunnar
Collaborator
Collaborator

Try This

 

Best regards Johan

 

 

Class ThisRule
Sub Main()
	Dim _VaulAddin As Inventor.ApplicationAddIn
	
	Try
		_VaulAddin = GetAddinByByName("Inventor Vault")
		_VaulAddin.DeActivate
	Catch
	
	End Try
	
	
	'***************** here is the ordinary code  *******************
	
	
	
	
	Try
		_VaulAddin = GetAddinByByName("Inventor Vault")	
		_VaulAddin.Activate
	Catch
	
	End Try
	
	
End Sub 	
	
		'***************** the function *******************
Function GetAddinByByName(displayName As String) As Inventor.ApplicationAddIn
    For Each i As Inventor.ApplicationAddIn In ThisServer.ApplicationAddIns
        If i.DisplayName = displayName Then
            Return i
        End If
    Next
    Return Nothing
End Function
	
	
	
End Class

 

 

0 Likes