10 Replies Latest reply on Aug 5, 2014 3:11 PM by Sam Kuhn

    Edit number of instances in linear pattern with VBA

    Sam Kuhn

      I am trying to write a product builder using macros.  I am new to VBA and the solidworks API in general.  What I am trying to do is modify a simple template part and change the number of extruded cuts patterned using a linear pattern.  The pattern is named "NotchPattern".  I also need to change the spacing, but if I get a working example of one, I'm sure I can figure out the other.

       

      I tried using example code from this post: https://forum.solidworks.com/message/314211 but I get errors on this line: Set swLocLinPatt = swFeat.GetDefinition

       

      Can anyone point me in the right direction?