ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
EPEvgenij Polupan10/08/2019

Good day.
A non-systemic (random) error occurred while calling SetAutomaticKutList of one part in different configurations.

Code below

for (int i = 0; i < vComps.Length; i++) 
{
   swComp = (Component2)vComps[i];
   NameswComp = swComp.GetPathName();
   if (swComp.IsSuppressed() == false)
   {
      NamePart = GetName(NameswComp);
      configName = swComp.ReferencedConfiguration;
      Feature swFeat = swComp.FirstFeature();

      while (swFeat != null)

      {

           if (swFeat.GetTypeName2() == "SolidBodyFolder" & NameswComp.ToLower().IndexOf(".sldasm") == -1)

           {

               swBodyFolder = (BodyFolder)swFeat.GetSpecificFeature2();

               swModelPart = swApp.OpenDoc6(NameswComp, (int)swDocumentTypes_e.swDocPART,                                 (int)swOpenDocOptions_e.swOpenDocOptions_ReadOnly, "", ref longstatus, ref longwarnings);

              swModelPart.ForceRebuild3(false);

              boolstatus = swModelPart.ShowConfiguration2(configName);

              boolstatus = swBodyFolder.SetAutomaticCutList(true); <<<<<<<<<<<<<< 0x80010108

              boolstatus = swBodyFolder.UpdateCutList();

              boolstatus = swBodyFolder.SetAutomaticCutList(false);

              swApp.CloseDoc(NameswComp);

              swModelPart = null;

              break;

           }

           swFeat = swFeat.GetNextFeature();

      }

   }

}

Tell me how to get around this error?