- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Error in Rule - InventorVb.RunMacro
Hello Everybody,
I have a macro, which one is working perfectly if I let run it from the Menu (Tools/Macros)
I made a little Rule to start this macro automaticly.
InventorVb.RunMacro("ApplicationProject", "Module2", "Perimeter")
If I try to use this Rule I got the following message:
Error in rule: Rule0, in document: Part1
User interrupt.
System.Runtime.InteropServices.COMException (0x80040561): User interrupt.
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.InventorVBAMember.Execute(Object& FunctionReturnValue)
at iLogic.LowLevelInRule.RunMacro(String projectName, String componentName, String macroName, Object[] args)
at ThisRule.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
Unfortunately I can't find any solution to solve this problem. Can anybody help for me?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, try this ilogic code to trigger a macro, if you can not activate it with the previous code.
Dim oP As InventorVBAProject For Each oP In ThisApplication.VBAProjects If oP.Name = "ApplicationProject" Then Dim oC As InventorVBAComponent For Each oC In oP.InventorVBAComponents If oC.Name = "Module1" Then Dim oM As InventorVBAMember For Each oM In oC.InventorVBAMembers If oM.Name = "prueba" Then ' "MyFunction" oM.Execute() End If Next oM End If Next oC End If Next oP
Check correctly the location path of the macro, otherwise it will not perform any action
I hope this helps solve your problem
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Thank you for your help. Unfortunately the situation is the same. The macro completed, my costum property made, but I got the error message. I need to use this property in another Rule.
A solution could be for me a rule which can close this error message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, What kind of error does the rule that provides you?
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a similar issue. Apparently the "ApplicationProject" was not loading correctly when this was run from a .dll, but worked from a local rule. This resolved it. @Sergio.D.Suárez Thank you very much! - Tim