3 Replies Latest reply on Oct 23, 2015 4:37 AM by Willie Roelofs

    Weldment Cutlist Properties

    Willie Roelofs

      Hi,

       

      I have a part with 1 and a part with 2 cut-list items. In both cases I want:

      - Get the last Cut-List-Item in the Cut List.

      - Get the DESCRIPTION property.

      - Use the description property in my macro to change custom properties.

       

      I don't know how to acces the "Cut-list item Properties".

       

      Could someone help me please.

       

       

      Kind regards,

      Willie Roelofs

        • Re: Weldment Cutlist Properties
          Viktor Bovzdarenko

          Hi

          This piece of code  ( for VSTA C#) will help you to get CustomPropertyManager for last item in the cut list of active part.

          U can modify custom properties from it:

           

                  public SldWorks swApp;

                  public ModelDoc2 swModel;

                  public void Main()

                  {

                      swModel = swApp.IActiveDoc2 as ModelDoc2;

                      CustomPropertyManager swCustPropMgr = default(CustomPropertyManager);

                      swCustPropMgr = fnCustPropMgr();

                  }

                  CustomPropertyManager fnCustPropMgr()

                  {

                      CustomPropertyManager swCustPropMgr = default(CustomPropertyManager);

                      Feature swFeat = (Feature)swModel.FirstFeature();           

                      while (swFeat != null)

                      {

                          if (swFeat.GetTypeName() == "CutListFolder")

                          {                   

                              swCustPropMgr = swFeat.CustomPropertyManager;                   

                          }

                          swFeat = (Feature)swFeat.GetNextFeature();

                      }

                      return swCustPropMgr;

                  }