5 Replies Latest reply on Jan 10, 2017 8:20 PM by Frank Wu Frank Wu

    Vba macro code running faster than vb.net nearly 7 times!!?

    Frank Wu Frank Wu

      Hello everyone!

      I have encountered some problems:

      I need to find some of the specified parts in the assembly by the component property name (eg 'Description').

      I run the VBA macro code in the API help - sample code 2015 SOLIDWORKS API Help - Traverse Assembly at Component and Feature Levels Using Recursion Example (VBA) , which runs very fast (38.3828125 sec).

      But I am more good at VB.NET, so I also run the vb.net code 2015 SOLIDWORKS API Help - Traverse Assembly at Component and Feature Levels Using Recursion Example (VB.NET) , but running up to 261.755971599996 sec!Much slower than the VBA macro code,nearly 7 times.

      I am very puzzled why such a problem.

      Could anyone give me some answers?

       

       

       

      My PC Info. :

      PC: DELL Precision T3600 Tower

      OS: Windows 7 Ultimate(64 bit /  SP1)

      CPU: Intel Xeon E5-1650 0 3.20GHz 6 core

      Memory: 16 GB ( DDR3 1600MHz )

      Hard Disk: Samsung SSD 840 PRO Series ( 256 GB )

      Video Adapter: Nvidia Quadro K2000 ( 2 GB / Nvidia )

      SolidWorks Ver. SolidWorks 2015 SP5

      VS2010

       

      Assembly info:

       

      Q1.bmp