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: 

Inventor freeze when Macros should load or run?

27 REPLIES 27
Reply
Message 1 of 28
ravivalon
1123 Views, 27 Replies

Inventor freeze when Macros should load or run?

Hi all

Working with inventor pro 2012, whenever I try to run a macro, the program freezes. It happens when I press the tools/macros button and it can take 30 sec or more before the macros dialog release and active or I can try to run windows job list which seems to release the jam too. It also happens when I try to run my macro with shortcut key or customized button. It freezes before the macro even loads and it is very frustrating. If I open the macros editor and run the macro from there (run sub) then there is no delay at all!    

Does anybody else have the same and if so do you have a solution?

Thanks

Alon

Autodesk Inventor 2012 SP1 64-bit, win 7 

27 REPLIES 27
Message 2 of 28

I have the same problem with one specific macro.

It is better since i placed all my macro in specific modules. I used to have: Module1 with Macro1, Macro 2, ... Macro 10.

Now I have Module_Macro1 with only Macro 1, Module_Macro2 with only Macro 2,..., Module_Macro10 with only Macro 10.

 

The difference between the macro that is slow and the others is that it has public declarations. I believe that this triggers the problem, but I'm not sure.

 

Hope this helps!

 

C

Message 3 of 28

Hi Chris

Thanks for your answer. I've also put several macros in one default location.

My problem starts even before the macro runs. It is when the "macros" dialog box (the window where you pick the macro to run) is loaded. The macros dialog appears but the program freezes. I can’t make a selection or even cancel until the dialog window unfreezes (with or without the help of windows job list). Once it comes to life again, there is no delay running the macro, regardless of public statements….

Any ideas?

Alon

Message 4 of 28

In my case it was linked to one specific macro that caused to slow all down (you also get this problem if you call the macro using a short cut and not the macro menu). So maybe start with duplicating your .VBA file. Load the new version (restart Inventor) and delete all macro except one very simple macro:

 

Sub test()
MsgBox "test"
End Sub

 

If the problem is gone you can start to add macro's. I would advise to copy paste them in different modules, as this helped me also allot.

 

Normally after a certain point the hanging reoccurs, and then you now which macro gives the problem.

 

If it is not a macro that's gives the problem then you should start looking to other possible causes.

Message 5 of 28

I’ve actually done that and more.

I’ve erased all macros from all modules. Right now there is not a single thing written in the vba default. I’ve tried to run the macro dialog with no file open (to prevent any relations to any project ipj) and it still happens. In other words, a clean new inventor session with no vba to work with and all I do is press the tools-macros button – and it freezes!

There is nothing to load for god sake. The only way to intervene is to launch job list!

It is really frustrating because my macros kick **** but if inventor freezes before loading or running them, then what’s the point.

 

I would really appreciate some clever Autodesk wiz to spring in action now. 

Message 6 of 28
MegaJerk
in reply to: ravivalon

Is the VBA project located on the same hard drive that Inventor is loaded on? I'm a bit curious. 



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
Message 7 of 28
ravivalon
in reply to: MegaJerk

Yes, it is all localy but- it happens even with no vba code. see my earlier msg.

Message 8 of 28
dano0310
in reply to: ravivalon

I have had this type of problem with a few of my larger macros.  Mine dont fully freeze though.

Some of them start moving when ever the mouse is moved.  Trick is to keep shaking it until it is done.

The other problem occurs when a select loop is run.  I have to change to another program then switch back to inventor for the prompt to come up down the bottom left corner which specifies which point or edge to select.

Haven't actually tried to track down the problem yet as I haven't had the time and I have also switched over to using VB.net.

Dan

Message 9 of 28
ravivalon
in reply to: dano0310

Thanks for your answer.

My problem occurs regardless of macro size or location. It happens when the macro dialog box pops up and before I can select a macro from the list. See my earlier post.

Alon

Message 10 of 28
xiaodong_liang
in reply to: ravivalon

Hi,

 

I am just wondering if the problem occurs when you ran the macro first time, or any times. 

 

If first time only, I think this is a normal behavior becasue it is similar to loading the VBA IDE. Inventor is demand-loading. So it will load relevant modules when it loads some module first time (such as VBA).

Message 11 of 28

For me it was just the first time. And only with a macro with a form.

 

The problem was that Inventor froze and didn't came true, so I needed to restart Inventor and load the VBA on a different way. I've solved this by adding a msgbox at the beginning of the macro. Inventor still freezes but after 20 - 30 seconds it comes true. After that first time Inventor works normally.

 

C

Message 12 of 28
karthur1
in reply to: xiaodong_liang

I have the same problem.  I have tried several things and never found the answer.  I started noticing this in Inventor 2011.  SInce I dont run macros manually very often, I just brushed it off.

 

For me, when I go to Tools>Macro, this dialog freezes for about 30-40sec.... then I can pick what macro I want to run.  It doesnt matter if its the first, second or third time I do this... I just have to wait on the dialog to become responsive.

 

I can start a new .ipt that has no vba code in it.  Got to Tools>Macros and I see the 30-40sec delay.

 

I have tried the default.ipj and it does the same thing.

Message 13 of 28
xiaodong_liang
in reply to: karthur1

Hi,

 

Two questions in this thread:

 

1) run macro with shortcut key or customized button. It freezes before the macro even loads and it is very frustrating.

   I created a macro and added it to User Commands. This macro pops out a simple dialog. It works well when I clicked the User Command. I did not see a freeze or any delay. My Inventor version Win7 64bit, 2012 + SP1 - English, or XP-32 2012 RTM - English. 

  So could anybody who have the problem provide more info on your enviorment? 

 

2)  when I press the tools/macros button and it can take 30 sec or more before the macros dialog release 

   I can sometimes see such problem on my Win7 - 64bit. But it never occurs on my XP-32. Are you also having the issue on 64bit?

Message 14 of 28

My VBA freeses only if I call a macro (for the first time) with a form attached to it.

 

Windows 7 professional, SP1, 64-Bit

Intel core i5 760@2.80ghz

6GB RAM

Inventor 2013 SP1.1

Message 15 of 28
karthur1
in reply to: xiaodong_liang

I am using

Windows 7 x64 -12 GB Ram
Intel i7-930 @ 3.60ghz
nVidia GTS 250 -1GB (Driver 301.42)
INV Pro R2013, SP1.1
Vault Basic 2013

Message 16 of 28

Thanks for the info. So looks both of you are using Win7 64.

 

1) run macro with shortcut key or customized button. It freezes before the macro even loads and it is very frustrating.

    

about this question, as said in the last message, I did not reproduce in 2012. On 2013 SP1.1 (Win7 64bits), I created a simple macro which pops out one message box and add this macro to a custom command. When I clicked the command, the dialog appears at once. Sometimes I can see Inventor will delay a little bit (2-5seconds) to respond again. But I did not see any long delay or freeze. 

 

2)  when I press the tools/macros button and it can take 30 sec or more before the macros dialog release 

     Sorry, I need to double check how often you can see such issue. always, or randomly. At my side, it always needs some seconds to wait for the dialog appears, but never 30 seconds. The longest is 10 seconds. 

Message 17 of 28
karthur1
in reply to: xiaodong_liang

What you describe in #2 is similar to what I am seeing. Here is two videos of what I am seeing.  In the first one, I go to Tools>Macros.  When this dialog comes up, the dialog is frozen.  It is very random how or what it takes to get the dialog to become active.  After about 30 secs, I can press ESC and the dialog will close.  Sometimes it takes as much as 60 secs to close the dialog.  I have tried picking the macro name, the "Macros in" drop down.  Alos try picking the top horizontal bar to drag the dialog... sometimes that makes it work.

 

The second video is how I get around it.  What I do is Tools>Macros.  After the dialog comes up, I click in a different active window, then back in the Inventor window.  The dialog is active and I can use it.

Message 18 of 28
brian
in reply to: karthur1

Hi Guys,

I have also seen the same thing randomly on my macros. Even when run from a custom button sometimes the app will run right away, sometimes it has a slight pause, sometimes it pauses for ages.

 

Im certain this is somehow a "losing focus" thing, as when it locks up indeed same as you I find the quickest way to get it back is to click on a different program or I start a window of windows explorer and bam the macro fires up.....

 

I was also told a while back that this was more to do with Windows 64bit and VBA compatibility issues. This kinda made sense at the time as when I started seeing this happen was also about the same time as we were moving to Win64 bit so I have just grudgingly lived with it.

 

Sure would be nice to fix it though 🙂

Message 19 of 28
xiaodong_liang
in reply to: karthur1

Hi 

Message 20 of 28

some comments from our engineer team:

 

Inventor VBA 6.5 is loaded along with inventor originally, which makes inventor launch very slow. So we have a designed choice to not load it when launching inventor: Tools->ApplicationOptions->Load VBA On Start-up.

Option1: If we choose not loading VBA when launching inventor, then VBA will be loaded along with we launch Macros, which make Macros dialog hang about 30s to 60s, just like the customer see.

Opeion2: If we choose loading VBA along inventor, then inventor will be launched a bit lower, but Macros can be launch very quick that the hang issue will disappear. Hope this can be a work around for Goodyear or old version user. 

 

Hope this helps.

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

Post to forums  

Autodesk Design & Make Report