1 Reply Latest reply on Sep 21, 2017 5:33 PM by Nilesh Patel

    Linear component Pattern

    Peter McCourt

      Hi, Could anyone explain to me how to use the FeatureLinearPattern5 method for components in an assembly? I am trying to create a linear component pattern of a part using the API in VBA.


      The below is what I am using at the minute:


      boolstatus = swModel.Extension.SelectByID2(" *PART TO BE PATTERNED*", "COMPONENT", 0, 0, 0, False, 0, Nothing, 0)  'Select Part to be Patterned

      boolstatus = swModel.Extension.SelectByID2("Top Plane", "PLANE", 0, 0, 0, True, 2, Nothing, 0)                                              'Direction to Pattern 1

      boolstatus = swModel.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, True, 4, Nothing, 0)                                            'Direction to Pattern 2


      ' Linear Pattern

      Dim swLinearPattern As Feature

      Set swLinearPattern = swModel.FeatureManager.FeatureLinearPattern2(4, 0.2, 2, 0.1, True, True, "FRONT PLANE", "TOP PLANE", False)


      This code selects the parts but the final line does nothing - swLinearPattern remains set to 'Nothing' in the locals window.