5 Replies Latest reply on May 1, 2018 1:18 PM by Mahir Abrahim

    InsertDerivedPattern - "Select Seed Position"

    Greg Lelonek

      I am having an issue with using the InsertDerivedPattern. I need to use the "Select Seed Position" to get the result as below. The seed component location is located at the bottom of he part. The green checkmarks represent the desired components to populate and the red x's represent the instances to skip. The Seed Feature is circle in blue.

       

       

      DerivedPatternIssue.JPG

       

      The recorded macro is as follows:

       

       

        public void Main()
              {

                  //Initialization Logic
                  ModelDoc2 swDoc = null;
                  PartDoc swPart = null;
                  DrawingDoc swDrawing = null;
                  AssemblyDoc swAssembly = null;
                  bool boolstatus = false;
                  int longstatus = 0;
                  int longwarnings = 0;
                  swDoc = ((ModelDoc2)(swApp.ActiveDoc)); 

                  swAssembly = ((AssemblyDoc)(swDoc));

                 

                  //Selection Logic
                  boolstatus = swDoc.Extension.SelectByID2("OriginalComponent1@Assembly1", "COMPONENT", 0.10619405049112629, 0.071735273144582834, 0.0013424569348785553, false, 1, null, 0);
                  boolstatus = swDoc.Extension.SelectByID2("", "FACE", 0.02408314654499577, 0.062579601820061725, 0.029625083137375441, true, 2, null, 0);
                  boolstatus = swDoc.Extension.SelectByID2("DrivingFeature@BaseComponent1@Assembly1", "SKETCHPOINT", 0, 0, 0, true, 4, null, 0);
              

                  //Inserts Derived Pattern Logic
                  boolstatus = swAssembly.InsertDerivedPattern();

       

              }

              /// <summary>
              ///  The SldWorks swApp variable is pre-assigned for you.
              /// </summary>
              public SldWorks swApp;

       

       

      -------------------------------------------------------------------------------------------------

       

      Does anyone have any functions to edit the "Select Seed Position" for the API?

       

      Thanks,

       

      Greg