AnsweredAssumed Answered

Edit number of instances in linear pattern with VBA

Question asked by Sam Kuhn on Jul 29, 2014
Latest reply on Aug 5, 2014 by 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?

Outcomes