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: 

VBA extremely slow IV2009 64 Bit

11 REPLIES 11
Reply
Message 1 of 12
chuck_b
618 Views, 11 Replies

VBA extremely slow IV2009 64 Bit

chuck_b
Enthusiast
Enthusiast
I did a test of my vba written code with Inventors internal VBA (Not using an Excel, etc) on a 64 bit computer to see if things would speed up. I found that the code runs fine but what takes 5 minutes on a 32 bit machine takes 1 1/2 hours on a 64 bit machine. Inventor does it's updates much quicker on the 64 bit machine and also opens large assemblies much faster. Not being able to use the vba programs is a big issue (Because they are too slow.). What are my options? Will I be forced to make 64 bit compiled programs to talk to Inventor 64 bit? Any input would be appreciated. Thanks, Chuck
0 Likes

VBA extremely slow IV2009 64 Bit

I did a test of my vba written code with Inventors internal VBA (Not using an Excel, etc) on a 64 bit computer to see if things would speed up. I found that the code runs fine but what takes 5 minutes on a 32 bit machine takes 1 1/2 hours on a 64 bit machine. Inventor does it's updates much quicker on the 64 bit machine and also opens large assemblies much faster. Not being able to use the vba programs is a big issue (Because they are too slow.). What are my options? Will I be forced to make 64 bit compiled programs to talk to Inventor 64 bit? Any input would be appreciated. Thanks, Chuck
11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: chuck_b

Anonymous
Not applicable
Microsoft has chosen not to release a 64 bit version of VBA. We wanted to
still be able to support VBA programs with the 64 bit version of Inventor
and came up with the approach of running VBA as a separate 32 bit process.
This works but results in the penalty of being out of process. For the best
performance on a 64 bit Inventor you'll need to write your application as an
Add-In.
--
Brian Ekins
Autodesk Inventor API
0 Likes

Microsoft has chosen not to release a 64 bit version of VBA. We wanted to
still be able to support VBA programs with the 64 bit version of Inventor
and came up with the approach of running VBA as a separate 32 bit process.
This works but results in the penalty of being out of process. For the best
performance on a 64 bit Inventor you'll need to write your application as an
Add-In.
--
Brian Ekins
Autodesk Inventor API
Message 3 of 12
chuck_b
in reply to: chuck_b

chuck_b
Enthusiast
Enthusiast
Thanks Brian,

I'll try turning off UserInteraction via code and see if that will be enough to speed up the VBA code.
0 Likes

Thanks Brian,

I'll try turning off UserInteraction via code and see if that will be enough to speed up the VBA code.
Message 4 of 12
Anonymous
in reply to: chuck_b

Anonymous
Not applicable
It probably won't make any difference. This already being done behind the
scenes when you use VBA with 64 bit Inventor. The only way to get
comparable speeds to VBA in 32 bit Inventor in 64 bit Inventor is to write
an Add-In.
--
Brian Ekins
Autodesk Inventor API
0 Likes

It probably won't make any difference. This already being done behind the
scenes when you use VBA with 64 bit Inventor. The only way to get
comparable speeds to VBA in 32 bit Inventor in 64 bit Inventor is to write
an Add-In.
--
Brian Ekins
Autodesk Inventor API
Message 5 of 12
Anonymous
in reply to: chuck_b

Anonymous
Not applicable
I did some timing tests on 32 and 64 bit versions of Inventor using some VBA
code. My basic test involved creating 500 occurrences within an assembly. I
found that it took aproximately the same amount of time on 32 and 64 bit.
Also, I was able to further speed up the process in 64 bit by setting

ThisApplication.UserInterfaceManager.UserInteractionDisabled = True (and
back to False at the end of the macro)

So, the VBA macro actually ran faster on 64 bit!

If you can post the code that demonstrates the problem, I can have a look at
it.

Sanjay-
0 Likes

I did some timing tests on 32 and 64 bit versions of Inventor using some VBA
code. My basic test involved creating 500 occurrences within an assembly. I
found that it took aproximately the same amount of time on 32 and 64 bit.
Also, I was able to further speed up the process in 64 bit by setting

ThisApplication.UserInterfaceManager.UserInteractionDisabled = True (and
back to False at the end of the macro)

So, the VBA macro actually ran faster on 64 bit!

If you can post the code that demonstrates the problem, I can have a look at
it.

Sanjay-
Message 6 of 12
chuck_b
in reply to: chuck_b

chuck_b
Enthusiast
Enthusiast
Thanks for testing this out Sanjay! The code that I compared the 32 bit to 64 bit has a ton of different things that it does and would take a long time to set it up for someone else to use. But just to give you a example of a snippet of that code: Lets say you have an assembly that has about 500 occurrences like you tested and some of the occurrences are nested about 4 sub assemblies deep. The first part of my code does a recursive iteration of all the occurrences in the parent assembly and adds each occurrence to an ObjectCollection object. This took about 2-6 seconds in VBA with 32 bit Inventor and almost 4 minutes on 64 bit Inventor. I haven't had a chance to try it with disabling userinteraction events yet. I only tried a quick test on a 64 bit machine that was borrowed to me for a day. I'll be getting my own 64 bit machine to test on in about a week and will be able to do some more extensive testing.
0 Likes

Thanks for testing this out Sanjay! The code that I compared the 32 bit to 64 bit has a ton of different things that it does and would take a long time to set it up for someone else to use. But just to give you a example of a snippet of that code: Lets say you have an assembly that has about 500 occurrences like you tested and some of the occurrences are nested about 4 sub assemblies deep. The first part of my code does a recursive iteration of all the occurrences in the parent assembly and adds each occurrence to an ObjectCollection object. This took about 2-6 seconds in VBA with 32 bit Inventor and almost 4 minutes on 64 bit Inventor. I haven't had a chance to try it with disabling userinteraction events yet. I only tried a quick test on a 64 bit machine that was borrowed to me for a day. I'll be getting my own 64 bit machine to test on in about a week and will be able to do some more extensive testing.
Message 7 of 12
chuck_b
in reply to: chuck_b

chuck_b
Enthusiast
Enthusiast
If you get a chance to try an object collection sample that would be great otherwise once I get that the 64 bit computer I'll try some generic routines that can reproduce the slow performance that I experienced. To give you a chance to diagnose what could be causing it. Inventor 2008 ran this code very fast and I couldn't even wait for the program to finish in Inventor 2009 64 bit because it was taking too long.
0 Likes

If you get a chance to try an object collection sample that would be great otherwise once I get that the 64 bit computer I'll try some generic routines that can reproduce the slow performance that I experienced. To give you a chance to diagnose what could be causing it. Inventor 2008 ran this code very fast and I couldn't even wait for the program to finish in Inventor 2009 64 bit because it was taking too long.
Message 8 of 12
chuck_b
in reply to: chuck_b

chuck_b
Enthusiast
Enthusiast
Sanjay,

I would also be willing to give you a pack & go and send you the vba project file. The code will fail if I don't give you all the data files. It would have to be done in confidential way. If there is secure ftp site for me to upload my stuff to you that would be great.

I was very excited when I opened up the assembly in 64 bit because it was lightning fast and updates were fast compared to 32 bit. Then when I ran the code I was very disappointed. Let me know if this is worth your time.

Chuck
0 Likes

Sanjay,

I would also be willing to give you a pack & go and send you the vba project file. The code will fail if I don't give you all the data files. It would have to be done in confidential way. If there is secure ftp site for me to upload my stuff to you that would be great.

I was very excited when I opened up the assembly in 64 bit because it was lightning fast and updates were fast compared to 32 bit. Then when I ran the code I was very disappointed. Let me know if this is worth your time.

Chuck
Message 9 of 12
Anonymous
in reply to: chuck_b

Anonymous
Not applicable
Chuck,

I 'm now able to reproduce the slowdown in some situations. I created about
200 points using TransientGeometry.CreatePoint method and it shows the
problem. The good news is that setting UserInteractionDisabled to True
always significantly improves the performance in all my tests. So you should
be able to use this workaround for now. I'm not sure why VBA is not
automatically taking advantage of this. I'll file a high priority case.

Thanks much for reporting this.

Sanjay-
0 Likes

Chuck,

I 'm now able to reproduce the slowdown in some situations. I created about
200 points using TransientGeometry.CreatePoint method and it shows the
problem. The good news is that setting UserInteractionDisabled to True
always significantly improves the performance in all my tests. So you should
be able to use this workaround for now. I'm not sure why VBA is not
automatically taking advantage of this. I'll file a high priority case.

Thanks much for reporting this.

Sanjay-
Message 10 of 12
chuck_b
in reply to: chuck_b

chuck_b
Enthusiast
Enthusiast
Awesome! Glad to hear that work around will help since it is a very easy work around to apply to the code.
0 Likes

Awesome! Glad to hear that work around will help since it is a very easy work around to apply to the code.
Message 11 of 12
chuck_b
in reply to: chuck_b

chuck_b
Enthusiast
Enthusiast
I ran this again on a 64 bit computer disabling user interaction and at least I was able to come up with the same speed as the 32 bit. My code does the following.
1) Gets all occurences in an assembly
2) adds each occurence to an ObjectCollection
3)Does and annalyze interference
4)Extrudes approximately 400 holes in sheet metal parts

This took me about 5 minutes on 32 bit and 5 minutes on 64 bit using vba.

My question is do you have to compile addins in 64 bit or can you still compile an addin in 32 bit? I'll like to test my code as an addin to see how much faster this will make it. Not sure if it is worth the trouble. If I'm not going to gain a tremendous amount of speed.


Thanks,

Chuck
0 Likes

I ran this again on a 64 bit computer disabling user interaction and at least I was able to come up with the same speed as the 32 bit. My code does the following.
1) Gets all occurences in an assembly
2) adds each occurence to an ObjectCollection
3)Does and annalyze interference
4)Extrudes approximately 400 holes in sheet metal parts

This took me about 5 minutes on 32 bit and 5 minutes on 64 bit using vba.

My question is do you have to compile addins in 64 bit or can you still compile an addin in 32 bit? I'll like to test my code as an addin to see how much faster this will make it. Not sure if it is worth the trouble. If I'm not going to gain a tremendous amount of speed.


Thanks,

Chuck
Message 12 of 12
Anonymous
in reply to: chuck_b

Anonymous
Not applicable
You need to create a 64 bit Add-in for it to run with 64 bit Inventor.

Since the 32 bit VBA runs in process with Inventor, I suspect things won't
run faster than that with an Add-in.

Sanjay-
0 Likes

You need to create a 64 bit Add-in for it to run with 64 bit Inventor.

Since the 32 bit VBA runs in process with Inventor, I suspect things won't
run faster than that with an Add-in.

Sanjay-

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

Post to forums  

Autodesk Design & Make Report